Skip to content
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

cmg/go: Spurious "Println arg list ends with redundant newline" from go test, Go 1.10 #23062

Closed
calmh opened this issue Dec 8, 2017 · 2 comments

Comments

@calmh
Copy link
Contributor

calmh commented Dec 8, 2017

This check is included in the new vet tests run in go test in Go 1.10 beta 1. In my opinion this is too far away from a 100% check, and mostly a style one at that. It fails tests on a binary that includes a

fmt.Println(`Usage:
    somecommand <args>

Description of the command.
More text here.
`)

and while it's correct (the string ends with a newline, and Println will add one more) this is the intended effect. You could argue that we should use cmd.Print instead and add the newline manually, and we could do that, but honestly I'm fine with it as is and think it should pass tests.

@ianlancetaylor
Copy link
Contributor

The topic of which issues to include in go vet as run by go test is being discussed on #18085. I've copied this comment over to that issue. Closing this issue to keep all the discussion in one place.

@randall77
Copy link
Contributor

I've run into this one as well, with almost the exact same code as the OP (a print of usage info for a binary).
Easy enough to work around, I guess, but annoying.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants