You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ go run ./tmp.go
4 0
$ go vet ./tmp.go
$
$ staticcheck --checks=all ./tmp.go
$
staticcheck does flag something like:
varcbyte=1c<<=len(s)
But len(s[:]) is not constant, even though it
can never change. Perhaps staticcheck could be taught
to reason about these
non-constant-but-immutable expressions.
The text was updated successfully, but these errors were encountered:
(Inspired by a comment from @go101.)
Consider:
staticcheck
does flag something like:But
len(s[:])
is , even though it can never change. Perhapsstaticcheck
could be taught to reason about these expressions.The text was updated successfully, but these errors were encountered: