-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: shadow false positive variable/type declaration in package block #18018
Comments
Note that
This behaviour is still confusing and perhaps a bug, but I would also say that you are not using the tool properly by specifying go files from different packages. That merges them into a single package. Have you tried |
I just realised that it says |
There is no expectation that any of the go tools will work properly when presented with a single directory containing multiple packages. |
@mvdan actually |
@meomap like any other |
What version of Go are you using (
go version
)?go version go1.7.3 darwin/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/meomap/testlinter"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/6f/tq_z_9xs71vg9wlv5yg8g_lm0000gn/T/go-build230941075=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
What did you do?
I run
go tool vet --shadow
on top repository of 3 packages, each has amain.go
file:vet command
What did you expect to see?
no vet error, same output as
What did you see instead?
but when I run same vet on
a/main.go
andb/main.go
only, no vet erroror change order of arguments input, no vet error
The text was updated successfully, but these errors were encountered: