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

cmd/vet: false positive for build flag when it appears in a string of source code #12269

Closed
srinathh opened this issue Aug 22, 2015 · 1 comment

Comments

@srinathh
Copy link
Contributor

I ran into a likely false positive from go vet when writing a program that auto-generates code.

This program generates a warning +build comment must appear before package clause and be followed by a blank line

This equivalent program without the // autogenerated by... comment in the first line doesn't

In either case, i don't think go vet should be vetting contents of the string,

@ianlancetaylor ianlancetaylor added this to the Unplanned milestone Aug 22, 2015
@robpike
Copy link
Contributor

robpike commented Aug 24, 2015

Unfortunate.

The algorithm it uses is very simple, but is fooled by this corner case. Not worth the trouble to fix.

@robpike robpike closed this as completed Aug 24, 2015
@golang golang locked and limited conversation to collaborators Aug 24, 2016
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