What version of Go are you using (go version)?
% go version
go version devel +68d4b1265e Sat Apr 20 19:34:03 2019 +0000 darwin/amd64
Does this issue reproduce with the latest release?
yes
What did you do?
(~/devel/vet) % ls
go.mod go.sum tools.go
(~/devel/vet) % cat go.mod
module github.com/davecheney/vetbug
go 1.13
require mvdan.cc/unparam v0.0.0-20190310220240-1b9ccfa71afe
(~/devel/vet) % cat tools.go
// +build tools
package main
import _ "mvdan.cc/unparam"
What did you expect to see?
% go vet
# github.com/davecheney/vetbug
./tools.go:1:1: +build comment must appear before package clause and be followed by a blank line
tools.go:4:8: import "mvdan.cc/unparam" is a program, not an importable package
What did you see instead?
(~/devel/vet) % go vet
tools.go:4:8: import "mvdan.cc/unparam" is a program, not an importable package
The failure to report the incorrect build tag on line 1 is masked by the complaint about the non importable package.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
yes
What did you do?
What did you expect to see?
What did you see instead?
The failure to report the incorrect build tag on line 1 is masked by the complaint about the non importable package.