| 1 |
{"TextWidth": 40} |
| 2 |
-- input -- |
| 3 |
If the arguments have version suffixes (like @latest or @v1.0.0), "go install" |
| 4 |
builds packages in module-aware mode, ignoring the go.mod file in the current |
| 5 |
directory or any parent directory, if there is one. This is useful for |
| 6 |
installing executables without affecting the dependencies of the main module. |
| 7 |
To eliminate ambiguity about which module versions are used in the build, the |
| 8 |
arguments must satisfy the following constraints: |
| 9 |
|
| 10 |
- Arguments must be package paths or package patterns (with "..." wildcards). |
| 11 |
They must not be standard packages (like fmt), meta-patterns (std, cmd, |
| 12 |
all), or relative or absolute file paths. |
| 13 |
|
| 14 |
- All arguments must have the same version suffix. Different queries are not |
| 15 |
allowed, even if they refer to the same version. |
| 16 |
|
| 17 |
- All arguments must refer to packages in the same module at the same version. |
| 18 |
|
| 19 |
- Package path arguments must refer to main packages. Pattern arguments |
| 20 |
will only match main packages. |
| 21 |
|
| 22 |
- No module is considered the "main" module. If the module containing |
| 23 |
packages named on the command line has a go.mod file, it must not contain |
| 24 |
directives (replace and exclude) that would cause it to be interpreted |
| 25 |
differently than if it were the main module. The module must not require |
| 26 |
a higher version of itself. |
| 27 |
|
| 28 |
- Vendor directories are not used in any module. (Vendor directories are not |
| 29 |
included in the module zip files downloaded by 'go install'.) |
| 30 |
|
| 31 |
If the arguments don't have version suffixes, "go install" may run in |
| 32 |
module-aware mode or GOPATH mode, depending on the GO111MODULE environment |
| 33 |
variable and the presence of a go.mod file. See 'go help modules' for details. |
| 34 |
If module-aware mode is enabled, "go install" runs in the context of the main |
| 35 |
module. |
| 36 |
-- text -- |
| 37 |
If the arguments have version suffixes |
| 38 |
(like @latest or @v1.0.0), "go install" |
| 39 |
builds packages in module-aware mode, |
| 40 |
ignoring the go.mod file in the current |
| 41 |
directory or any parent directory, |
| 42 |
if there is one. This is useful for |
| 43 |
installing executables without affecting |
| 44 |
the dependencies of the main module. |
| 45 |
To eliminate ambiguity about which |
| 46 |
module versions are used in the build, |
| 47 |
the arguments must satisfy the following |
| 48 |
constraints: |
| 49 |
|
| 50 |
- Arguments must be package paths |
| 51 |
or package patterns (with "..." |
| 52 |
wildcards). They must not be |
| 53 |
standard packages (like fmt), |
| 54 |
meta-patterns (std, cmd, all), |
| 55 |
or relative or absolute file paths. |
| 56 |
|
| 57 |
- All arguments must have the same |
| 58 |
version suffix. Different queries |
| 59 |
are not allowed, even if they refer |
| 60 |
to the same version. |
| 61 |
|
| 62 |
- All arguments must refer to packages |
| 63 |
in the same module at the same |
| 64 |
version. |
| 65 |
|
| 66 |
- Package path arguments must refer |
| 67 |
to main packages. Pattern arguments |
| 68 |
will only match main packages. |
| 69 |
|
| 70 |
- No module is considered the "main" |
| 71 |
module. If the module containing |
| 72 |
packages named on the command line |
| 73 |
has a go.mod file, it must not |
| 74 |
contain directives (replace and |
| 75 |
exclude) that would cause it to be |
| 76 |
interpreted differently than if it |
| 77 |
were the main module. The module |
| 78 |
must not require a higher version of |
| 79 |
itself. |
| 80 |
|
| 81 |
- Vendor directories are not used in |
| 82 |
any module. (Vendor directories are |
| 83 |
not included in the module zip files |
| 84 |
downloaded by 'go install'.) |
| 85 |
|
| 86 |
If the arguments don't have version |
| 87 |
suffixes, "go install" may run in |
| 88 |
module-aware mode or GOPATH mode, |
| 89 |
depending on the GO111MODULE environment |
| 90 |
variable and the presence of a go.mod |
| 91 |
file. See 'go help modules' for details. |
| 92 |
If module-aware mode is enabled, |
| 93 |
"go install" runs in the context of the |
| 94 |
main module. |