commit | 2f9474bbbce5a8d318444070c8b6765441dfd366 | [log] [tgz] |
---|---|---|
author | Russ Cox <rsc@golang.org> | Wed Jul 04 00:28:41 2018 -0400 |
committer | Russ Cox <rsc@golang.org> | Tue Jul 10 20:09:48 2018 +0000 |
tree | 0aa63e1bd6d9a6f0497d294a75caca4dad9d7324 | |
parent | cdd82a7bc7c6d7c407792afe279ed74331335370 [diff] |
cmd/go/internal/vgo: adjust 'module mode enabled' decision This new implementation matches the recently-written help docs, which say: For more fine-grained control, the module support in Go 1.11 respects a temporary environment variable, GO111MODULE, which can be set to one of three string values: off, on, or auto (the default). If GO111MODULE=off, then the go command never uses the new module support. Instead it looks in vendor directories and GOPATH to find dependencies; we now refer to this as "GOPATH mode." If GO111MODULE=on, then the go command requires the use of modules, never consulting GOPATH. We refer to this as the command being module-aware or running in "module-aware mode". If GO111MODULE=auto or is unset, then the go command enables or disables module support based on the current directory. Module support is enabled only when the current directory is outside GOPATH/src and itself contains a go.mod file or is below a directory containing a go.mod file. The global -vgo flag is removed in favor of the environment variable. Change-Id: I935466cb5cd6825a5c6926d012eab2cb74bb2832 Reviewed-on: https://go-review.googlesource.com/122260 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.