go: don't cast enum
parent
1500a3ad4d
commit
6b3d76680f
|
@ -878,7 +878,7 @@ internal
|
|||
><span aria-hidden="true" class="octicon octicon-link"></span
|
||||
></a>
|
||||
</div>
|
||||
<p>Don't cast proto enum:</p>
|
||||
<p>Don't cast enum:</p>
|
||||
<div class="highlight highlight-source-go">
|
||||
<pre><span class="pl-c">// Bad</span>
|
||||
<span class="pl-s1">a</span> <span class="pl-c1">:=</span> <span class="pl-s1">cast</span>.<span class="pl-en">ToInt32</span>(<span class="pl-s1">servicev1</span>.<span class="pl-c1">ReasonCode_ABC</span>)
|
||||
|
|
|
@ -441,7 +441,7 @@ Example with `matryer/moq`:
|
|||
|
||||
### Be careful with [spf13/cast](https://github.com/spf13/cast)
|
||||
|
||||
Don't cast proto enum:
|
||||
Don't cast enum:
|
||||
|
||||
```go
|
||||
// Bad
|
||||
|
|
Loading…
Reference in New Issue