Skip to content

"go vet" generates a warning for any call to Error with a string containing % #6407

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

Closed
gopherbot opened this issue Sep 17, 2013 · 3 comments
Closed

Comments

@gopherbot
Copy link
Contributor

by [email protected]:

I'm using the latest version of go vet from code.google.com/p/go.tools/cmd/vet

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Define a function Error(a, b)
2. Call Error("%", "")
3. See spurious warning from "go vet".

http://play.golang.org/p/m8yVe4vSbB

What is the expected output?
I would not expect a warning in this case.

What do you see instead?
t.go:7: possible formatting directive in Error call

Which version are you using?  (run 'go version')
"go vet" tip
@adg
Copy link
Contributor

adg commented Sep 17, 2013

Comment 1:

Vet sometimes generates false positives. It's hard to avoid. Assigning to r in case he
thinks something should be done about it, but I suspect this might be WorkingAsIntended.

Owner changed to @robpike.

Status changed to Thinking.

@robpike
Copy link
Contributor

robpike commented Sep 17, 2013

Comment 2:

Working as intended.

Status changed to WorkingAsIntended.

@gopherbot
Copy link
Contributor Author

Comment 3 by [email protected]:

Understood.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
@rsc rsc unassigned robpike Jun 22, 2022
This issue was closed.
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

3 participants