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

vet: check for "+build" comment inconsistently reports error in package doc #26681

Closed
kr opened this issue Jul 30, 2018 · 2 comments
Closed

vet: check for "+build" comment inconsistently reports error in package doc #26681

kr opened this issue Jul 30, 2018 · 2 comments

Comments

@kr
Copy link
Contributor

kr commented Jul 30, 2018

What version of Go are you using (go version)?

go version go1.11beta2 darwin/amd64

Does this issue reproduce with the latest release?

Yes.

What did you do?

https://play.golang.org/p/xABgz0L94ig

What did you expect to see?

No error message, as in https://play.golang.org/p/v6DLrueUHqN.

What did you see instead?

prog.go:5: +build comment must appear before package clause and be followed by a blank line

This makes it a little difficult to include example code in the package doc, when the example needs to show a build directive.

Note that it's not just interpreting the +build ignore as a build directive inside the package comment. If we alter that line so that line alone doesn't look like a Go comment, vet reports no error: https://play.golang.org/p/v6DLrueUHqN

@kr
Copy link
Contributor Author

kr commented Jul 30, 2018

Oops, I think this is a duplicate of #26627.

@meirf
Copy link
Contributor

meirf commented Jul 30, 2018

@kr yea they look similar. I'm gonna close this, but please comment there if you feel the conversation/CLs in #26627 are not addressing your exact concerns.

@meirf meirf closed this as completed Jul 30, 2018
@golang golang locked and limited conversation to collaborators Jul 30, 2019
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