Skip to content

Commit f8bfdc9

Browse files
author
Jay Conrod
committed
cmd/go: adjust documentation mentioning 'go get'
In module-aware mode, 'go get' no longer builds or installs packages. - 'go generate' explains build commands do not run generate commands. 'go get' is no longer a build command, so this CL removes mention of it. - 'go get' will continue to accept build flags, but they're ignored. The documentation no longer mentions them, though it does mention -x for printing VCS commands. For #43684 Change-Id: I1eea7241eecf72ba9f98238b729d91cc77ec7665 Reviewed-on: https://go-review.googlesource.com/c/go/+/355209 Trust: Jay Conrod <jayconrod@google.com> Run-TryBot: Jay Conrod <jayconrod@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Bryan C. Mills <bcmills@google.com>
1 parent 6e0adde commit f8bfdc9

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/cmd/go/alldocs.go

Lines changed: 6 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/go/internal/generate/generate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Generate runs commands described by directives within existing
3838
files. Those commands can run any process but the intent is to
3939
create or update Go source files.
4040
41-
Go generate is never run automatically by go build, go get, go test,
41+
Go generate is never run automatically by go build, go test,
4242
and so on. It must be run explicitly.
4343
4444
Go generate scans the file for directives, which are lines of

src/cmd/go/internal/modget/get.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ current directory. For example:
8383
8484
See 'go help install' or https://golang.org/ref/mod#go-install for details.
8585
86-
In addition to build flags (listed in 'go help build') 'go get' accepts the
87-
following flags.
86+
'go get' accepts the following flags.
8887
8988
The -t flag instructs get to consider modules needed to build tests of
9089
packages specified on the command line.
@@ -99,6 +98,10 @@ but changes the default to select patch releases.
9998
When the -t and -u flags are used together, get will update
10099
test dependencies as well.
101100
101+
The -x flag prints commands as they are executed. This is useful for
102+
debugging version control commands when a module is downloaded directly
103+
from a repository.
104+
102105
For more about modules, see https://golang.org/ref/mod.
103106
104107
For more about specifying packages, see 'go help packages'.

0 commit comments

Comments
 (0)