]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/modload: fix boundary conditions in matchPackages
authorBryan C. Mills <bcmills@google.com>
Fri, 19 Apr 2019 16:27:25 +0000 (12:27 -0400)
committerBryan C. Mills <bcmills@google.com>
Fri, 19 Apr 2019 18:37:41 +0000 (18:37 +0000)
commit14b5b4a2a13c3148fdfeb4852436661791a13e2e
tree6337a69616340a63aa76011cb47603fbe61c42cb
parentdbe32284ff4fb96906cdb121508eba668dbc5bae
cmd/go/internal/modload: fix boundary conditions in matchPackages

This makes the boundary logic of matchPackages consistent with
modload.dirInModule.

Previously, matchPackages always stopped at go.mod file, even within
the vendor tree. However, we do not guarantee that the vendor tree is
free of such files in general.

matchPackages also issued needless stat operations for modules in the
module cach, which we already know to be free of nested modules. On
systems with slow filesystems (such as macOS), those extra calls could
potentially slow package matching considerably.

Change-Id: I71979ab752e1d3971b370b37085d30502690413b
Reviewed-on: https://go-review.googlesource.com/c/go/+/172985
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/modload/search.go
src/cmd/go/testdata/script/mod_patterns_vendor.txt [new file with mode: 0644]