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

srinathh opened this issue Aug 22, 2015 · 1 comment


Copy link

@srinathh srinathh commented Aug 22, 2015

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
Copy link

@robpike robpike commented Aug 24, 2015


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

@robpike robpike closed this 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.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.