Skip to content

Commit 902d5aa

Browse files
committed
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. Fixes #34053 Change-Id: I8bcd637fd8ec423d597fcdab2a0ceedd20786019 Reviewed-on: https://go-review.googlesource.com/c/go/+/200957 Run-TryBot: Agniva De Sarker <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
1 parent c721994 commit 902d5aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cmd/go/internal/work/exec.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1023,7 +1023,7 @@ func (b *Builder) vet(a *Action) error {
10231023
// dependency tree turn on *more* analysis, as here.
10241024
// (The unsafeptr check does not write any facts for use by
10251025
// later vet runs.)
1026-
if a.Package.Goroot && !VetExplicit {
1026+
if a.Package.Goroot && !VetExplicit && VetTool == "" {
10271027
// Note that $GOROOT/src/buildall.bash
10281028
// does the same for the misc-compile trybots
10291029
// and should be updated if these flags are

0 commit comments

Comments
 (0)