]> Cypherpunks repositories - gostls13.git/commitdiff
[release-branch.go1.13] cmd/go/internal/work: fix error while passing custom vet...
authorAgniva De Sarker <agnivade@yahoo.co.in>
Sun, 13 Oct 2019 15:03:47 +0000 (20:33 +0530)
committerAlexander Rakoczy <alex@golang.org>
Thu, 17 Oct 2019 18:29:51 +0000 (18:29 +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.

Updates #34053
Fixes #34922

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>
(cherry picked from commit 902d5aa84f8340752c20b93bfd450a6cefcf3952)
Reviewed-on: https://go-review.googlesource.com/c/go/+/201237
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Agniva De Sarker <agniva.quicksilver@gmail.com>
src/cmd/go/internal/work/exec.go

index 7ff7b810f6f5b0317026065a8a2d0b56097c8262..7dd9a90c18695666e6d26976d058f0c851babaf9 100644 (file)
@@ -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