-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/tools/go/analysis/passes/printf, cmd/vet: gate non-constant format string check on 1.24 language version #71485
Comments
Related Issues
Related Documentation (Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
Change https://go.dev/cl/645595 mentions this issue: |
The new check added in golang/go#60529 reports errors for non-constant format strings with no arguments. These are almost always bugs, but are often mild or inconsequential, and can be numerous in existing code bases. To reduce friction from this change, gate the new check on the implied language version. For golang/go#71485 Change-Id: I4926da2809dd14ba70ae530cd1657119f5377ad5 Reviewed-on: https://go-review.googlesource.com/c/tools/+/645595 Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Robert Findley <rfindley@google.com>
Change https://go.dev/cl/645615 mentions this issue: |
Change https://go.dev/cl/645697 mentions this issue: |
…rrors for non-const format strings The new check added in golang/go#60529 reports errors for non-constant format strings with no arguments. These are almost always bugs, but are often mild or inconsequential, and can be numerous in existing code bases. To reduce friction from this change, gate the new check on the implied language version. For golang/go#71485 Change-Id: I4926da2809dd14ba70ae530cd1657119f5377ad5 Reviewed-on: https://go-review.googlesource.com/c/tools/+/645595 Reviewed-by: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Auto-Submit: Robert Findley <rfindley@google.com> (cherry picked from commit 9f450b0) Reviewed-on: https://go-review.googlesource.com/c/tools/+/645697
Change https://go.dev/cl/645336 mentions this issue: |
The new check added to the printf analyzer in #60529 reports errors for non-constant format strings. In almost all cases we've investigated, these turn out to be bugs.
However, they are mild bugs, and the analyzer can produce quite a large number of findings.
We experienced this in our own codebase when the analyzer landed, and the community is experiencing a similar amount of churn:
https://lwn.net/ml/fedora-devel/CAM4%3DqPKbUw4DoLkdXtk4XJM718bm8soGuHE%2BL58Lq5UJ%3DBZBwg%40mail.gmail.com/
To reduce the friction caused by this change, we should gate the new check on a 1.24 language version, so as to not break the tests of existing codebases. Users can address the new vet errors incrementally as they update the language versions of their modules.
(@rsc and @adonovan suggest doing this as a matter of principle when we add new vet checks, but that is a policy question outside the scope of this issue)
Marking this as a release blocker, to guard the RC.
The text was updated successfully, but these errors were encountered: