Commit 2ce643d3 authored by Bryan C. Mills's avatar Bryan C. Mills

cmd/go: document GO111MODULE=auto behavior for Go 1.13

Fixes #31857

Change-Id: Ic4afe1262d863112db97794edc1ade20f6926d64
Reviewed-on: https://go-review.googlesource.com/c/go/+/180197Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
parent 98100c56
...@@ -2260,23 +2260,26 @@ ...@@ -2260,23 +2260,26 @@
// //
// Module support // Module support
// //
// Go 1.13 includes official support for Go modules, // Go 1.13 includes support for Go modules. Module-aware mode is active by default
// including a module-aware 'go get' command. // whenever a go.mod file is found in, or in a parent of, the current directory.
// Module-aware mode is active by default. //
// The quickest way to take advantage of module support is to check out your
// repository, create a go.mod file (described in the next section) there, and run
// go commands from within that file tree.
// //
// For more fine-grained control, Go 1.13 continues to respect // For more fine-grained control, Go 1.13 continues to respect
// a temporary environment variable, GO111MODULE, which can be set to one // a temporary environment variable, GO111MODULE, which can be set to one
// of three string values: off, auto, or on (the default). // of three string values: off, on, or auto (the default).
// If GO111MODULE=on or is unset, then the go command requires the use of // If GO111MODULE=on, then the go command requires the use of modules,
// modules, never consulting GOPATH. We refer to this as the command // never consulting GOPATH. We refer to this as the command
// being module-aware or running in "module-aware mode". // being module-aware or running in "module-aware mode".
// If GO111MODULE=auto, 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.
// If GO111MODULE=off, then the go command never uses // If GO111MODULE=off, then the go command never uses
// module support. Instead it looks in vendor directories and GOPATH // module support. Instead it looks in vendor directories and GOPATH
// to find dependencies; we now refer to this as "GOPATH mode." // to find dependencies; we now refer to this as "GOPATH 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 contains a
// go.mod file or is below a directory containing a go.mod file.
// //
// In module-aware mode, GOPATH no longer defines the meaning of imports // In module-aware mode, GOPATH no longer defines the meaning of imports
// during a build, but it still stores downloaded dependencies (in GOPATH/pkg/mod) // during a build, but it still stores downloaded dependencies (in GOPATH/pkg/mod)
......
...@@ -21,23 +21,26 @@ which source files are used in a given build. ...@@ -21,23 +21,26 @@ which source files are used in a given build.
Module support Module support
Go 1.13 includes official support for Go modules, Go 1.13 includes support for Go modules. Module-aware mode is active by default
including a module-aware 'go get' command. whenever a go.mod file is found in, or in a parent of, the current directory.
Module-aware mode is active by default.
The quickest way to take advantage of module support is to check out your
repository, create a go.mod file (described in the next section) there, and run
go commands from within that file tree.
For more fine-grained control, Go 1.13 continues to respect For more fine-grained control, Go 1.13 continues to respect
a temporary environment variable, GO111MODULE, which can be set to one a temporary environment variable, GO111MODULE, which can be set to one
of three string values: off, auto, or on (the default). of three string values: off, on, or auto (the default).
If GO111MODULE=on or is unset, then the go command requires the use of If GO111MODULE=on, then the go command requires the use of modules,
modules, never consulting GOPATH. We refer to this as the command never consulting GOPATH. We refer to this as the command
being module-aware or running in "module-aware mode". being module-aware or running in "module-aware mode".
If GO111MODULE=auto, 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.
If GO111MODULE=off, then the go command never uses If GO111MODULE=off, then the go command never uses
module support. Instead it looks in vendor directories and GOPATH module support. Instead it looks in vendor directories and GOPATH
to find dependencies; we now refer to this as "GOPATH mode." to find dependencies; we now refer to this as "GOPATH 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 contains a
go.mod file or is below a directory containing a go.mod file.
In module-aware mode, GOPATH no longer defines the meaning of imports In module-aware mode, GOPATH no longer defines the meaning of imports
during a build, but it still stores downloaded dependencies (in GOPATH/pkg/mod) during a build, but it still stores downloaded dependencies (in GOPATH/pkg/mod)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment