We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using go1.4.1 linux/amd64 and golang.org/x/tools 1afe783e9f23b46389ab7a439ed4e0eee558382a.
1afe783e9f23b46389ab7a439ed4e0eee558382a
Run the following source (playground link) and then run go vet on the same file:
go vet
fmt.Printf("%[0]s\n", "arg1") fmt.Printf("%[0]d\n", 1)
You'll see the following output:
$ go run vet.go %!s(BADINDEX) %!d(BADINDEX) $ go vet vet.go vet.go:9: arg "%[0]d\n" for printf verb %d of wrong type: string exit status 1
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.
vet
The text was updated successfully, but these errors were encountered:
Proposed fix: https://go-review.googlesource.com/#/c/3692/
Sorry, something went wrong.
Fixed in golang/tools@913f41f
No branches or pull requests
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: