cmd/vet: no or incorrect warning for zero-based indexing in printf format #9752
Labels
Comments
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Using go1.4.1 linux/amd64 and golang.org/x/tools
1afe783e9f23b46389ab7a439ed4e0eee558382a
.Run the following source (playground link) and then run
go vet
on the same file:You'll see the following output:
There was no warning for the first format and a misleading warning for the second format.
vet
does warn for negative or out of bounds indices, so for consistency I think it should also warn that indices are one-based.The text was updated successfully, but these errors were encountered: