cmd/go/internal/modfetch: fix Lookup, Import; add ImportRepoRev

- Explain Lookup and Import, module paths vs import paths.

- Add ImportRepoRev, because neither Lookup nor Import
  is appropriate for translating legacy versioning system configs.
  There's more to do in ImportRepoRev, but it's already more
  accurate than before.

- Drop the old ad-hoc logic about github/bitbucket/etc
  in favor of resolving source code hosts using the "go get" logic.
  This enables paths like git.apache.org/thrift.git/lib/go/thrift again.

- Structure $GOPATH/src/mod/cache a little more: make separate
  top-level directories mod/cache/download and mod/cache/vcs.

Fixes golang/go#23983.
Fixes golang/go#24687.
Fixes golang/go#25590.
Fixes golang/go#25654.

Change-Id: I0de2d75c5846a1c054079e1c67b9a1100ed161c8
Reviewed-on: https://go-review.googlesource.com/120042
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
11 files changed
tree: 58a0744dc94caa1e473272537cb722148f50de26
  1. vendor/
  2. AUTHORS
  3. codereview.cfg
  4. CONTRIBUTING.md
  5. CONTRIBUTORS
  6. LICENSE
  7. main.go
  8. PATENTS
  9. README.md
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.