Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/vet: ignore build comments in string literals #17580
package p const buildtag = ` // +build abc `
$ go tool vet x.go x.go:4: +build comment must appear before package clause and be followed by a blank line
This is a detectable false positive. This is very unlikely to be an actual attempt at a build comment; it's inside a string literal. This happens when writing code generators. There's a concrete instance in TestBinaryOnlyPackages in cmd/go/go_test.go.