Description
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:
- cmd/cover/cover.go:43:2: fmt.Fprintln arg list ends with redundant newline
Line 43 in cfd016d
- cmd/trace/main.go:69:3: fmt.Fprintln arg list ends with redundant newline
Line 69 in cfd016d
- cmd/vendor/github.com/google/pprof/internal/report/source.go:877:2: fmt.Fprintln arg list ends with redundant newline
(Build log.)
Those packages fail to build because cmd/go
(CC @bcmills, @matloob) considers this vet problem fatal during go test
. E.g.:
$ go test cmd/cover
# cmd/cover
cmd/cover/cover.go:43:2: fmt.Fprintln arg list ends with redundant newline
FAIL cmd/cover [build failed]
FAIL
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.