commit | 94c68ad279b3c55957e57efe805c47533e51e9f1 | [log] [tgz] |
---|---|---|
author | Russ Cox <rsc@golang.org> | Tue Jul 10 13:55:26 2018 -0400 |
committer | Russ Cox <rsc@golang.org> | Thu Jul 12 03:18:12 2018 +0000 |
tree | 584704800bc543af666fbc185d128753fbf3e08f | |
parent | a42a7e886866b90f9feaa22e3f1307ce2d051d50 [diff] |
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>
This repository holds a prototype of what the go command might look like with integrated support for package versioning.
See research.swtch.com/vgo for documents about the design.
Use go get -u golang.org/x/vgo
.
You can also manually git clone the repository to $GOPATH/src/golang.org/x/vgo
.
See CONTRIBUTING.md.
This is still a very early prototype. You are likely to run into bugs. Please file bugs in the main Go issue tracker, golang.org/issue, and put the prefix x/vgo:
in the issue title.
Thank you.