cmd/go/internal/get: export RepoRootForImportPath for use by modfetch

Because we've decided to keep support for the old meta tags
and hosting repository special cases, it makes sense for
package modfetch to import package get to translate an
import path to the enclosing repository root.

This CL exports RepoRootForImportPath from package get
for use in package modfetch. It also adjusts the import graph
to make it possible for modfetch to import get.
Before this CL, the graph has get -> load -> vgo -> modfetch,
so modfetch cannot import get. This CL reverses the load -> vgo
so that vgo is once again a higher-level package, and then
there's no problem with modfetch importing get.
Eventually some of the details currently isolated to package vgo
will move out to the packages that need them, and then we
won't have these awkward func values being set during
initialization.

This CL does not make modfetch import get; it only does the
preparation necessary to enable that.

Change-Id: I985964c40be3d3e7bd34be9d939c2fb8c76107fd
Reviewed-on: https://go-review.googlesource.com/119675
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
12 files changed
tree: 9ec7363d9d032758aa94ed3d08c9f44a78f3ae8e
  1. AUTHORS
  2. CONTRIBUTING.md
  3. CONTRIBUTORS
  4. LICENSE
  5. PATENTS
  6. README.md
  7. codereview.cfg
  8. main.go
  9. vendor/
README.md

Versioned Go Prototype (vgo)

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.

Download/Install

Use go get -u golang.org/x/vgo.

You can also manually git clone the repository to $GOPATH/src/golang.org/x/vgo.

Report Issues / Send Patches

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.