New issue
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
cmd/vet: possible to get a printf false positive with big.Int #30399
Comments
Thanks for the detailed report! This is a false positive, as This tiny program reproduces the bug:
It seems like the issue is that vet assumes that a program must import You can see that this is the cause because adding an I'll send a CL to the tools repo later today, and I'm sure we can include a backport for 1.12.1's cmd/vet. /cc @alandonovan |
@alandonovan now that cmd/vet is out of repo, how can we easily backport single commits? With git it should be possible to cherry-pick the x/tools commit into cmd/vendor/golang.org/x/tools, but I don't know if you have a better plan. |
I also messed up the "Fixes" line in the x/tools commit, as usual. But that's actually good, as the issue isn't fixed in neither master nor 1.12. |
I don't have any better ideas than simply applying the same change to both repos. The x/tools/go/analysis tree is subject to the release freeze, so I don't think there's any situation in which they should deviate. |
Ah right, I keep forgetting that x/tools has a 1.12 branch as well. I presume we can just cherry-pick into its 1.12 branch, and update Go's 1.12 branch to vendor x/tools' updated 1.12 branch. |
The x/tools piece was merged over a month ago; this just needs someone to update the vendored copy into a Go 1.12.x release. Unassigning myself, as I'm not needed for that bit. |
(for completeness, the 1.12 tools CL was https://go-review.googlesource.com/c/tools/+/164657) |
Change https://golang.org/cl/174519 mentions this issue: |
Change https://golang.org/cl/174520 mentions this issue: |
Closed by merging dc6db5f to release-branch.go1.12. |
Closed by merging 9ac7093 to release-branch.go1.12. |
…date from release-branch.go1.12 $ ./update-xtools.sh Copied /Users/rsc/src/golang.org/x/tools@aa829657 to . $ cd ~/src/golang.org/x/tools $ git log -n1 aa829657 commit aa82965741a9fecd12b026fbb3d3c6ed3231b8f8 (HEAD -> release-branch.go1.12, origin/release-branch.go1.12) Author: Daniel Martí <mvdan@mvdan.cc> AuthorDate: Fri Mar 1 11:00:19 2019 +0000 Commit: Brad Fitzpatrick <bradfitz@golang.org> CommitDate: Wed Mar 13 21:06:03 2019 +0000 ... $ Picks up cmd/vet fixes that have been inadvertently missed in point releases so far. Fixes #30399. Fixes #30465. Change-Id: Ibcfaac51d134205b986b32f857d54006b19c896a Reviewed-on: https://go-review.googlesource.com/c/go/+/174519 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Add explicit tests for: #30465 cmd/vet: Consider reverting tag conflict for embedded fields #30399 cmd/vet: possible to get a printf false positive with big.Int because we have managed not to fix them in the last couple point releases, and it will be too embarrassing to do that yet again. Change-Id: Ib1da5df870348b6eb9bfc8a87c507ecc6d44b8dd Reviewed-on: https://go-review.googlesource.com/c/go/+/174520 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Here's a full repro:
What did you expect to see?
The exact same test code (
main_test.go
) is present in bothbn256/cloudflare
andbn256/google
. I expect either both to fail with the format error, or neither of them.What did you see instead?
Cloudflare always passes, Google always fails.
The text was updated successfully, but these errors were encountered: