]> Cypherpunks repositories - gostls13.git/commit
cmd/go: add global ignore mechanism
authorSam Thanawalla <samthanawalla@google.com>
Wed, 8 Jan 2025 18:30:50 +0000 (18:30 +0000)
committerSam Thanawalla <samthanawalla@google.com>
Fri, 16 May 2025 15:39:57 +0000 (08:39 -0700)
commitf529d56508b4bbb1e3707917404be57e9b815ccd
tree88830d14320a356bef894f7260f2abab4ded093b
parentb450b5409dbdec1810873413b1213fc543f43a39
cmd/go: add global ignore mechanism

This CL adds the ignore directive which enables users to tell the Go
Command to skip traversing into a given directory.

This behaves similar to how '_' or 'testdata' are currently treated.
This mainly has benefits for go list and go mod tidy.
This does not affect what is packed into a module.

Fixes: #42965
Change-Id: I232e27c1a065bb6eb2d210dbddad0208426a1fdd
Reviewed-on: https://go-review.googlesource.com/c/go/+/643355
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>
13 files changed:
src/cmd/go/alldocs.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/modcmd/edit.go
src/cmd/go/internal/modload/modfile.go
src/cmd/go/internal/modload/search.go
src/cmd/go/internal/search/search.go
src/cmd/go/testdata/script/build_dash_x.txt
src/cmd/go/testdata/script/build_ignoredirective.txt [new file with mode: 0644]
src/cmd/go/testdata/script/list_ignore.txt [new file with mode: 0644]
src/cmd/go/testdata/script/list_ignore_dependency.txt [new file with mode: 0644]
src/cmd/go/testdata/script/list_ignore_workspace.txt [new file with mode: 0644]
src/cmd/go/testdata/script/mod_edit.txt
src/cmd/go/testdata/script/mod_tidy_ignore.txt [new file with mode: 0644]