diff --git a/cmd/vet/buildtag.go b/cmd/vet/buildtag.go index 0ab13cb8..2d86edf7 100644 --- a/cmd/vet/buildtag.go +++ b/cmd/vet/buildtag.go @@ -55,7 +55,7 @@ func checkBuildTag(name string, data []byte) { continue } if i >= cutoff { - fmt.Fprintf(os.Stderr, "%s:%d: +build comment appears too late in file\n", name, i+1) + fmt.Fprintf(os.Stderr, "%s:%d: +build comment must appear before package clause and be followed by a blank line\n", name, i+1) setExit(1) continue } diff --git a/cmd/vet/testdata/buildtag.go b/cmd/vet/testdata/buildtag.go index 7959c5a7..eb36fd32 100644 --- a/cmd/vet/testdata/buildtag.go +++ b/cmd/vet/testdata/buildtag.go @@ -9,6 +9,6 @@ package testdata -// +build toolate // ERROR "build comment appears too late in file" +// +build toolate // ERROR "build comment must appear before package clause and be followed by a blank line" var _ = 3 diff --git a/cmd/vet/testdata/buildtag_bad.go b/cmd/vet/testdata/buildtag_bad.go index 0a0a39bd..fbe10cf7 100644 --- a/cmd/vet/testdata/buildtag_bad.go +++ b/cmd/vet/testdata/buildtag_bad.go @@ -7,7 +7,7 @@ // +build !!bang // ERROR "invalid double negative in build constraint" // +build @#$ // ERROR "invalid non-alphanumeric build constraint" -// +build toolate // ERROR "build comment appears too late in file" +// +build toolate // ERROR "build comment must appear before package clause and be followed by a blank line" package bad // This is package 'bad' rather than 'main' so the erroneous build