@@ -19,34 +19,25 @@ including recording and resolving dependencies on other modules.
19
19
Modules replace the old GOPATH-based approach to specifying
20
20
which source files are used in a given build.
21
21
22
- Preliminary module support
22
+ Module support
23
23
24
- Go 1.11 includes preliminary support for Go modules,
25
- including a new module-aware 'go get' command.
26
- We intend to keep revising this support, while preserving compatibility,
27
- until it can be declared official (no longer preliminary),
28
- and then at a later point we may remove support for work
29
- in GOPATH and the old 'go get' command.
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.
30
27
31
- The quickest way to take advantage of the new Go 1.11 module support
32
- is to check out your repository into a directory outside GOPATH/src,
33
- create a go.mod file (described in the next section) there, and run
34
- go commands from within that file tree.
35
-
36
- For more fine-grained control, the module support in Go 1.11 respects
28
+ For more fine-grained control, Go 1.13 continues to respect
37
29
a temporary environment variable, GO111MODULE, which can be set to one
38
- of three string values: off, on, or auto (the default).
39
- If GO111MODULE=off, then the go command never uses the
40
- new module support. Instead it looks in vendor directories and GOPATH
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
+ 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
+ If GO111MODULE=off, then the go command never uses
39
+ module support. Instead it looks in vendor directories and GOPATH
41
40
to find dependencies; we now refer to this as "GOPATH mode."
42
- If GO111MODULE=on, then the go command requires the use of modules,
43
- never consulting GOPATH. We refer to this as the command being
44
- module-aware or running in "module-aware mode".
45
- If GO111MODULE=auto or is unset, then the go command enables or
46
- disables module support based on the current directory.
47
- Module support is enabled only when the current directory is outside
48
- GOPATH/src and itself contains a go.mod file or is below a directory
49
- containing a go.mod file.
50
41
51
42
In module-aware mode, GOPATH no longer defines the meaning of imports
52
43
during a build, but it still stores downloaded dependencies (in GOPATH/pkg/mod)
0 commit comments