]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: document GO111MODULE=auto behavior for Go 1.13
authorBryan C. Mills <bcmills@google.com>
Mon, 3 Jun 2019 16:13:54 +0000 (12:13 -0400)
committerBryan C. Mills <bcmills@google.com>
Mon, 3 Jun 2019 17:02:01 +0000 (17:02 +0000)
Fixes #31857

Change-Id: Ic4afe1262d863112db97794edc1ade20f6926d64
Reviewed-on: https://go-review.googlesource.com/c/go/+/180197
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/go/alldocs.go
src/cmd/go/internal/modload/help.go

index 2df97a429c5fe1f3138364814050dfa4d3e44503..63470694cd44ea61c911d82c0aaefd56e676af7d 100644 (file)
 //
 // Module support
 //
-// Go 1.13 includes official support for Go modules,
-// including a module-aware 'go get' command.
-// Module-aware mode is active by default.
+// Go 1.13 includes support for Go modules. Module-aware mode is active by default
+// whenever a go.mod file is found in, or in a parent of, the current directory.
+//
+// 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
 // a temporary environment variable, GO111MODULE, which can be set to one
-// of three string values: off, auto, or on (the default).
-// If GO111MODULE=on or is unset, then the go command requires the use of
-// modules, never consulting GOPATH. We refer to this as the command
+// of three string values: off, on, or auto (the default).
+// 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, 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
 // module support. Instead it looks in vendor directories and GOPATH
 // 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
 // during a build, but it still stores downloaded dependencies (in GOPATH/pkg/mod)
index cb996d3546e317e4f894a91d4288f7611c0a9362..74ee985590a43a5ade4a1245bccfd7dd65dba955 100644 (file)
@@ -21,23 +21,26 @@ which source files are used in a given build.
 
 Module support
 
-Go 1.13 includes official support for Go modules,
-including a module-aware 'go get' command.
-Module-aware mode is active by default.
+Go 1.13 includes support for Go modules. Module-aware mode is active by default
+whenever a go.mod file is found in, or in a parent of, the current directory.
+
+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
 a temporary environment variable, GO111MODULE, which can be set to one
-of three string values: off, auto, or on (the default).
-If GO111MODULE=on or is unset, then the go command requires the use of
-modules, never consulting GOPATH. We refer to this as the command
+of three string values: off, on, or auto (the default).
+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, 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
 module support. Instead it looks in vendor directories and GOPATH
 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
 during a build, but it still stores downloaded dependencies (in GOPATH/pkg/mod)