]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/work: fix error while passing custom vet tool
authorAgniva De Sarker <agnivade@yahoo.co.in>
Sun, 13 Oct 2019 15:03:47 +0000 (20:33 +0530)
committerAgniva De Sarker <agniva.quicksilver@gmail.com>
Mon, 14 Oct 2019 14:45:59 +0000 (14:45 +0000)
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 <agniva.quicksilver@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/work/exec.go

index 71eb5d9cd3fb7218bbf089b99916a65d63896e38..0f25a5d19fca62270a1483acb389c3d03637f5b9 100644 (file)
@@ -1023,7 +1023,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