]> Cypherpunks repositories - gostls13.git/commit
cmd/go: refactor load.LoadPackage into other functions
authorJay Conrod <jayconrod@google.com>
Fri, 15 Mar 2019 17:41:48 +0000 (13:41 -0400)
committerJay Conrod <jayconrod@google.com>
Mon, 1 Apr 2019 13:50:27 +0000 (13:50 +0000)
commitd6b2b35e641eeac9f764d21dcaed46973b3e2720
tree49c05f207d4db79fe4a8540616436fe1399d5341
parent4091cf972a37418c847426bd15709cd0128fad81
cmd/go: refactor load.LoadPackage into other functions

LoadPackage was used to load a *load.Package for a command line
argument, after pattern expansion. It provided two special cases on
top of LoadImport. First, it ensured that "cmd/" packages in GOROOT
were installed in "$GOROOT/bin" or "$GOROOT/pkg/tool". Second, it
translated absolute paths to packages in GOROOT and GOPATH into
regular import paths.

With this change, LoadImport now ensures "cmd/" packages have the
right Target (without the need for a special case) and
search.ImportPaths translates absolute paths.

LoadPackage no longer handles these special cases and has been renamed
to LoadImportWithFlags, since it's still useful for loading implicit
dependencies.

Updates #29758

Change-Id: I9d54036f90c3ccd9b3a0fe0eaddaa7749593cc91
Reviewed-on: https://go-review.googlesource.com/c/go/+/167748
Run-TryBot: Jay Conrod <jayconrod@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/get/get.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/search/search.go
src/cmd/go/internal/test/test.go
src/cmd/go/internal/work/action.go
src/cmd/go/internal/work/gc.go