cmd/vet: not reporting bad index for the incorrect statement #15884
Comments
Work on this is a bit more complicated as the initial patch only solves part of the problem, the indexing part still needs a bit more work. |
I have updated the description with the other bad case scenario. |
@dlsniper , @quentinmit , see the CL for this issue - https://go-review.googlesource.com/24391 . |
CL https://golang.org/cl/24391 mentions this issue. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
go version
)?1.6.2
go env
)?linux/amd64
The following code:
produces a
BADINDEX
at runtime howevergo vet
doesn't catch it. To correct the code one should add a tenth argument to thePrintf
function and all should be ok.In fact it should catch if the function has more than 9 other arguments (besides the formatting string) but it doesn't.
The other scenario is this:
https://play.golang.org/p/snrXok614V
An error about the
BADINDEX
No error.
The text was updated successfully, but these errors were encountered: