-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/vet: update for new number formats #29986
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
Comments
Change https://golang.org/cl/160246 mentions this issue: |
Change https://golang.org/cl/160245 mentions this issue: |
This CL modifies fmt's printer to implement %x and %X for formatting floating-point data (floats and complexes) in standard hexadecimal notation. See golang.org/design/19308-number-literals for background. For #29008. Vet update is #29986. Change-Id: If2842a11631bc393a1ebcf6914ed07658652af5a Reviewed-on: https://go-review.googlesource.com/c/160245 Reviewed-by: Robert Griesemer <[email protected]> Reviewed-by: Rob Pike <[email protected]>
This CL modifies fmt's printer to implement %#b and %O to emit leading 0b and 0o prefixes on binary and octal. (%#o is already taken and emits "0377"; %O emits "0o377".) See golang.org/design/19308-number-literals for background. For #19308. For #12711. Vet update is #29986. Change-Id: I7c38a4484c48a03abe9f6d45c7d981c7c314f583 Reviewed-on: https://go-review.googlesource.com/c/160246 Reviewed-by: Robert Griesemer <[email protected]> Reviewed-by: Rob Pike <[email protected]>
It looks like vet's update for the new octal format verb 'O' would go here. |
Change https://golang.org/cl/235100 mentions this issue: |
%O is supported since Go 1.13. See golang.org/design/19308-number-literals for the background. Support for %O has been added by copying and adapting the %o implementation. Updates golang/go#29986 Change-Id: Ic49d3cc8d9aefcc0ecbfcfe5ebf206e6f951d413 Reviewed-on: https://go-review.googlesource.com/c/tools/+/235100 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
As far as I can tell this bug should be fixed. @rsc, could you double check and mark this bug as fixed? |
Also as |
I don't think this is fixed until we import a new version of the packages into the main sources. |
This comment has been minimized.
This comment has been minimized.
@gopherbot Please open backport issues for 1.13 and 1.14 "go vet" should permit %O in fmt.Printf formats, as the formatting code was added in the 1.13 release. |
Backport issue(s) opened: #39287 (for 1.13), #39288 (for 1.14). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
@ianlancetaylor note that The changes in question are: |
@michael-schaller True. At a quick glance it seems like those two are fixed in 1.14, but not in 1.13. |
@ianlancetaylor please let me know if I can help in some other way with this bug. I'm curious how this is all handled... ;-) |
The version of the golang.org/x/tools module is specified in the src/cmd/go.mod files on the release branches for Go 1.14 and 1.13:
The release branches in golang.org/x/tools should correspond to those pseudo-versions:
This is already the case for 1.14, but the x/tools release-branch.go1.13 is incorrect (it's many commits ahead) and will need to be reset to match the version selected in https://github.com/golang/go/blob/release-branch.go1.13/src/cmd/go.mod#L11. Then, it's a matter of backporting the relevant vet fixes to each of the x/tools release branches, and updating the go.mod (and re-running Given it's quite a bit of mechanics, it's likely a good idea to wait until the backport issues (#39288 and #39287) make progress from their current CherryPickCandidate state before starting the work. |
The backport issues have been approved. I'll also add release-blocker to this to track the vendor of CL 235100 into the main tree. |
Change https://golang.org/cl/236138 mentions this issue: |
@dmitshur Sorry, didn't notice that you had assigned this to yourself. |
@ianlancetaylor That is not a problem. I noticed you've sent the CL thanks to gopherbot's message above just before I started doing any work. I reviewed your CL. Thank you. |
Change https://golang.org/cl/236161 mentions this issue: |
… strings %O is supported since Go 1.13. See golang.org/design/19308-number-literals for the background. Support for %O has been added by copying and adapting the %o implementation. For golang/go#39288. For golang/go#29986. Change-Id: Ic49d3cc8d9aefcc0ecbfcfe5ebf206e6f951d413 Reviewed-on: https://go-review.googlesource.com/c/tools/+/235100 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> (cherry picked from commit 8b020ae) Reviewed-on: https://go-review.googlesource.com/c/tools/+/236161 Run-TryBot: Dmitri Shuralyov <[email protected]>
Change https://golang.org/cl/236199 mentions this issue: |
Change https://golang.org/cl/237945 mentions this issue: |
… strings %O is supported since Go 1.13. See golang.org/design/19308-number-literals for the background. Support for %O has been added by copying and adapting the %o implementation. Updates golang/go#29986. For golang/go#39287. Change-Id: Ic49d3cc8d9aefcc0ecbfcfe5ebf206e6f951d413 Reviewed-on: https://go-review.googlesource.com/c/tools/+/235100 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-on: https://go-review.googlesource.com/c/tools/+/237945 Run-TryBot: Dmitri Shuralyov <[email protected]>
Change https://golang.org/cl/238018 mentions this issue: |
…0602230032-c00d67ef29d0 This teaches vet to recognize %O in a fmt.Printf format string. O has been supported since the 1.13 release, but vet would warn about it. Fixes #39288. For #29986. Change-Id: Ia7817ee60ae6beac32cc402c0c68afa917e4ef0f Reviewed-on: https://go-review.googlesource.com/c/go/+/236199 Run-TryBot: Dmitri Shuralyov <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
…0615191743-991d59a616de This teaches vet to recognize the new formats %#b and %O on integers, %x on float/complex. They have been supported since the 1.13 release, but vet would warn about it. Also update cmd/vet testdata accordingly, as was done in CL 202083. Fixes #39287. For #29986. Change-Id: Ia7817ee60ae6beac32cc402c0c68afa917e4ef0f Reviewed-on: https://go-review.googlesource.com/c/go/+/238018 Run-TryBot: Dmitri Shuralyov <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
cmd/vet once again lives outside the main tree (sigh).
We need to remember to update the printf checker for
the new formats %#b and %O on integers, %x on float/complex.
The text was updated successfully, but these errors were encountered: