From: Agniva De Sarker Date: Sun, 13 Oct 2019 15:03:47 +0000 (+0530) Subject: [release-branch.go1.13] cmd/go/internal/work: fix error while passing custom vet... X-Git-Tag: go1.13.3~4 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0b575b4fb052f87d564cbbc31489b5a1923a01d3;p=gostls13.git [release-branch.go1.13] cmd/go/internal/work: fix error while passing custom vet tool For GOROOT packages, we were adding -unsafeptr=false to prevent unsafe.Pointer checks. But the flag also got passed to invocations of go vet with a custom vet tool. To prevent this from happening, we add this flag only when no tools are passed. Updates #34053 Fixes #34922 Change-Id: I8bcd637fd8ec423d597fcdab2a0ceedd20786019 Reviewed-on: https://go-review.googlesource.com/c/go/+/200957 Run-TryBot: Agniva De Sarker TryBot-Result: Gobot Gobot Reviewed-by: Jay Conrod (cherry picked from commit 902d5aa84f8340752c20b93bfd450a6cefcf3952) Reviewed-on: https://go-review.googlesource.com/c/go/+/201237 Run-TryBot: Bryan C. Mills Reviewed-by: Agniva De Sarker --- diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index 7ff7b810f6..7dd9a90c18 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -1030,7 +1030,7 @@ func (b *Builder) vet(a *Action) error { // dependency tree turn on *more* analysis, as here. // (The unsafeptr check does not write any facts for use by // later vet runs.) - if a.Package.Goroot && !VetExplicit { + if a.Package.Goroot && !VetExplicit && VetTool == "" { // Note that $GOROOT/src/buildall.bash // does the same for the misc-compile trybots // and should be updated if these flags are