]> git.feebdaed.xyz Git - 0xmirror/go.git/commit
cmd/go/internal/vet: skip -fix on pkgs from vendor or non-main mod
authorAlan Donovan <adonovan@google.com>
Fri, 5 Dec 2025 17:41:21 +0000 (12:41 -0500)
committerGopher Robot <gobot@golang.org>
Fri, 5 Dec 2025 22:29:25 +0000 (14:29 -0800)
commitc270e7183582600aa54dcc8bb14aeecf61fc4275
tree2d6a589f1f7e04ab0dd3d2ba996cd13913f2fff8
parent745349712e837ef77eb7b5a21c4d4e5c7ca0371a
cmd/go/internal/vet: skip -fix on pkgs from vendor or non-main mod

This change causes go fix (and go vet -fix) to skip applying fixes
to any package in the vendor/ tree, including the GOROOT vendor
packages that are part of std, and to any package from a non-main
module (since these usually come from the readonly module cache).

+ test

Fixes golang/go#76479

Change-Id: Ifdb73e09fbe413b4d99a92e5081b8ea43460be0b
Reviewed-on: https://go-review.googlesource.com/c/go/+/727300
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
src/cmd/go/internal/vet/vet.go
src/cmd/go/testdata/script/fix_vendor.txt [new file with mode: 0644]