@@ -21,23 +21,26 @@ which source files are used in a given build.
21
21
22
22
Module support
23
23
24
- Go 1.13 includes official support for Go modules,
25
- including a module-aware 'go get' command.
26
- Module-aware mode is active by default.
24
+ Go 1.13 includes support for Go modules. Module-aware mode is active by default
25
+ whenever a go.mod file is found in, or in a parent of, the current directory.
26
+
27
+ The quickest way to take advantage of module support is to check out your
28
+ repository, create a go.mod file (described in the next section) there, and run
29
+ go commands from within that file tree.
27
30
28
31
For more fine-grained control, Go 1.13 continues to respect
29
32
a temporary environment variable, GO111MODULE, which can be set to one
30
- of three string values: off, auto , or on (the default).
31
- If GO111MODULE=on or is unset , then the go command requires the use of
32
- modules, never consulting GOPATH. We refer to this as the command
33
+ of three string values: off, on , or auto (the default).
34
+ If GO111MODULE=on, then the go command requires the use of modules,
35
+ never consulting GOPATH. We refer to this as the command
33
36
being module-aware or running in "module-aware mode".
34
- If GO111MODULE=auto, then the go command enables or disables module
35
- support based on the current directory. Module support is enabled only
36
- when the current directory is outside GOPATH/src and itself contains a
37
- go.mod file or is below a directory containing a go.mod file.
38
37
If GO111MODULE=off, then the go command never uses
39
38
module support. Instead it looks in vendor directories and GOPATH
40
39
to find dependencies; we now refer to this as "GOPATH mode."
40
+ If GO111MODULE=auto or is unset, then the go command enables or disables
41
+ module support based on the current directory.
42
+ Module support is enabled only when the current directory contains a
43
+ go.mod file or is below a directory containing a go.mod file.
41
44
42
45
In module-aware mode, GOPATH no longer defines the meaning of imports
43
46
during a build, but it still stores downloaded dependencies (in GOPATH/pkg/mod)
0 commit comments