@@ -4,12 +4,8 @@ Vendoring in std and cmd
4
4
The Go command maintains copies of external packages needed by the
5
5
standard library in the src/vendor and src/cmd/vendor directories.
6
6
7
- In GOPATH mode, imports of vendored packages are resolved to these
8
- directories following normal vendor directory logic
9
- (see golang.org/s/go15vendor).
10
-
11
- In module mode, std and cmd are modules (defined in src/go.mod and
12
- src/cmd/go.mod). When a package outside std or cmd is imported
7
+ There are two modules, std and cmd, defined in src/go.mod and
8
+ src/cmd/go.mod. When a package outside std or cmd is imported
13
9
by a package inside std or cmd, the import path is interpreted
14
10
as if it had a "vendor/" prefix. For example, within "crypto/tls",
15
11
an import of "golang.org/x/crypto/cryptobyte" resolves to
@@ -34,14 +30,15 @@ Maintaining vendor directories
34
30
==============================
35
31
36
32
Before updating vendor directories, ensure that module mode is enabled.
37
- Make sure GO111MODULE=off is not set ('on' or 'auto' should work).
33
+ Make sure that GO111MODULE is not set in the environment, or that it is
34
+ set to 'on' or 'auto'.
38
35
39
36
Requirements may be added, updated, and removed with 'go get'.
40
37
The vendor directory may be updated with 'go mod vendor'.
41
38
A typical sequence might be:
42
39
43
40
cd src
44
- go get -d golang.org/x/net@latest
41
+ go get golang.org/x/net@latest
45
42
go mod tidy
46
43
go mod vendor
47
44
0 commit comments