-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go/internal/modload: finish Import implementation
modload.Import now means "figure out what this import means in the main module", including searching for a module to add to go.mod if the import is missing. (Previously it only did the search.) Fix Import to handle overlapping module file trees correctly: the fact that x/y/z is in the build list does not mean it is the module that must provide x/y/z/v2/w or even x/y/z/w. The definition of "go get x@v" is now easy to explain: if x is a module path, go get is talking about that module. Otherwise go get is talking about the module that provides or would provide x if encountered as an import in the main module. Simplify the package load process by using the new Import to eliminate the separate doMissing parallel pass, as suggested by Bryan in an earlier code review. Drop modload.SrcMod in favor of modfetch.SrcMod, and guard against SrcMod unset (filepath.Join(x, y) treats x="" as like x="."), which can happen in tests. Fixes golang/go#24851. Fixes golang/go#26048. Fixes golang/go#26250. Change-Id: I16abfa0c095492fc10ccd75f5857c1c087935867 Reviewed-on: https://go-review.googlesource.com/123095 Reviewed-by: Bryan C. Mills <bcmills@google.com>
- Loading branch information
Showing
15 changed files
with
469 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.