]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/search: consolidate package-pattern predicates into Match methods
authorBryan C. Mills <bcmills@google.com>
Thu, 27 Feb 2020 20:52:32 +0000 (15:52 -0500)
committerBryan C. Mills <bcmills@google.com>
Fri, 28 Feb 2020 19:05:54 +0000 (19:05 +0000)
commitd11e1f92fc578c5d2e604acfe9ea60d7afb84a0c
tree7903355bf2672af603635dd928b8d1aad8967d22
parent156c60709e7775a6f1baa9685155b5974fefdea9
cmd/go/internal/search: consolidate package-pattern predicates into Match methods

This change consolidates predicates currently scattered throughout
various parts of the package and module loader into methods on the
search.Match type.

That not only makes them more concise, but also encourages
consistency, both in the code and in reasoning about the kinds of
patterns that need to be handled. (For example, the IsLocal predicate
was previously two different calls, either of which could be easily
forgotten at a given call site.)

Factored out from CL 185344 and CL 185345.

Updates #32917

Change-Id: Ifa450ffaf6101f673e0ed69ced001a487d6f9335
Reviewed-on: https://go-review.googlesource.com/c/go/+/221458
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/internal/get/get.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/modload/load.go
src/cmd/go/internal/modload/query.go
src/cmd/go/internal/search/search.go