]> Cypherpunks repositories - gostls13.git/commit
cmd/go: distinguish patterns from the results of matching them
authorRuss Cox <rsc@golang.org>
Fri, 10 Aug 2018 17:26:32 +0000 (13:26 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 17 Aug 2018 19:21:57 +0000 (19:21 +0000)
commitd46587c4eaaf64a7e9cb0797fcfa238f5138b170
tree44babdf5839a0f951a2909235b55251785933557
parent08d10f9af1429d19633722e36f7bfeda6c000aa5
cmd/go: distinguish patterns from the results of matching them

To date the go command has always just treated the command line
package patterns as a []string, expanded by pattern matching into
another []string. As a result, the code is not always clear about
whether a particular []string contains patterns or results.
A few different important bugs are caused by not keeping
this distinction clear enough. This CL sets us up well for fixing those,
by introducing an explicit search.Match struct holding the
results of matching a single pattern.

The added clarity here also makes it clear how to avoid duplicate
warnings about unmatched packages.

Fixes #26925. (Test in followup CL.)

Change-Id: Ic2f0606f7ab8b3734a40e22d3cb1e6f58d031061
Reviewed-on: https://go-review.googlesource.com/129058
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Alan Donovan <adonovan@google.com>
src/cmd/go/internal/get/get.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/modcmd/why.go
src/cmd/go/internal/modget/get.go
src/cmd/go/internal/modload/load.go
src/cmd/go/internal/search/search.go
src/cmd/go/internal/work/build.go