-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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/cover, cmd/trace, cmd/vendor/github.com/google/pprof/internal/report: fmt.Fprintln arg list ends with redundant newline #49322
Comments
This comment has been minimized.
This comment has been minimized.
I think the promotion to failure actually comes via Lines 72 to 80 in 2ebe77a
|
@bcmills Ah, indeed, thanks. I misread the "[build failed]" line. Can confirm building is okay:
|
These look like TPs to me (although the severity might be low). Given that build actually succeeds, is this still considered a release-blocker? |
Yes: |
Yes, and for future vet changes, the tree must always be clean before committing the vet check. Thanks! |
Change https://golang.org/cl/361265 mentions this issue: |
Change https://golang.org/cl/361263 mentions this issue: |
This redundancy is now caught by the improved printf vet checker (#30436). Updates #49322 Change-Id: Id450247adc6fa28a9244c019be3c1b52c2d17f49 Reviewed-on: https://go-review.googlesource.com/c/go/+/361263 Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Zvonimir Pavlinovic <zpavlinovic@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
This redundancy is now caught by the improved printf vet checker. Updates #49322 Change-Id: Ic7a931b8d4838be02ebb855b69624b95093bd114 Reviewed-on: https://go-review.googlesource.com/c/go/+/361265 Run-TryBot: Zvonimir Pavlinovic <zpavlinovic@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Zvonimir Pavlinovic <zpavlinovic@google.com> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Can someone teach me why it is a bad idea to use |
It looks to me that catching patterns mentioned above was the intention of the checker from the outset. That is, the reason why this did not pop up earlier is due to a certain limitation. I might be wrong though. |
I was hoping to find some more detail about the motivation behind this check, and looked for the CL that added it. It looks like it was added in the "initial commit" for vet in 2010, CL 3522041. Back then, it worked on *ast.BasicLit only. It's possible #30436 is a bigger improvement for other print checks like "possible formatting directive", and maybe it scales less well for the newline check. |
Change https://golang.org/cl/361294 mentions this issue: |
Issue #30436 was about improving cmd/vet to detect when a fmt.Fprintln arg list ends with a redundant newline regardless of syntax (previously, it worked only when the string was a ast.BasicLit).
CL 356830 resolved that issue recently, and when it is brought into the main tree (as is being done in CL 361094, it finds 3 problems in the standard library tree:
go/src/cmd/cover/cover.go
Line 43 in cfd016d
go/src/cmd/trace/main.go
Line 69 in cfd016d
go/src/cmd/vendor/github.com/google/pprof/internal/report/source.go
Line 877 in cfd016d
(Build log.)
Those packages fail to build because
cmd/go
(CC @bcmills, @matloob) considers this vet problem fatal duringgo test
. E.g.:This needs to be resolved to unblock the 1.18 release.
As far as I understand, the vet check is working as intended and we should fix the 3 places. The one in pprof will need to fixed upstream and vendored in.
The improvement to the vet check may be worth mentioning in 1.18 release notes (#47694).
CC @golang/release, @zpavlinovic, @timothy-king.
The text was updated successfully, but these errors were encountered: