]> Cypherpunks repositories - gostls13.git/commit
cmd/vet: honor analyzer flags when running vet outside $GOROOT/src
authorXiangdong Ji <xiangdong.ji@arm.com>
Fri, 22 Nov 2019 17:02:06 +0000 (17:02 +0000)
committerJay Conrod <jayconrod@google.com>
Tue, 3 Dec 2019 15:26:50 +0000 (15:26 +0000)
commit2ac1ca9160f52907ce1cd04738c80b1c055b5ba6
tree168ebba0bd289d3af4f188444c601a9bd8482312
parent386b1a4280d4a32cd8b69a92ba91b6d98832b721
cmd/vet: honor analyzer flags when running vet outside $GOROOT/src

Additional vet flags specified by user are discarded if 'go vet'
is invoked outside $GOROOT/src to check a package under $GOROOT
(including those under "vendor" of $GOROOT), fix it by avoiding the
overwriting, the logic of detemining if the package under vetting
comes from $GOROOT remains untouched.

Also checked 'go tool vet <options> <cfg>' and 'go vet <options>
<user pkg>', both worked w./w.o this fix.

Fixes #35837.

Change-Id: I549af7964e40440afd35f2d1971f77eee6f8de34
Reviewed-on: https://go-review.googlesource.com/c/go/+/209498
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/work/exec.go
src/cmd/go/testdata/script/vet_flags.txt [new file with mode: 0644]