]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: adjust documentation mentioning 'go get'
authorJay Conrod <jayconrod@google.com>
Mon, 11 Oct 2021 22:51:10 +0000 (15:51 -0700)
committerJay Conrod <jayconrod@google.com>
Tue, 12 Oct 2021 18:31:29 +0000 (18:31 +0000)
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>
src/cmd/go/alldocs.go
src/cmd/go/internal/generate/generate.go
src/cmd/go/internal/modget/get.go

index 8a2109619d975ec6170f3d56c631486a171bc1e2..c3e4179025550bf64627bdcdb6c7ded7dd3a8efa 100644 (file)
 // files. Those commands can run any process but the intent is to
 // create or update Go source files.
 //
-// Go generate is never run automatically by go build, go get, go test,
+// Go generate is never run automatically by go build, go test,
 // and so on. It must be run explicitly.
 //
 // Go generate scans the file for directives, which are lines of
 //
 // See 'go help install' or https://golang.org/ref/mod#go-install for details.
 //
-// In addition to build flags (listed in 'go help build') 'go get' accepts the
-// following flags.
+// 'go get' accepts the following flags.
 //
 // The -t flag instructs get to consider modules needed to build tests of
 // packages specified on the command line.
 // When the -t and -u flags are used together, get will update
 // test dependencies as well.
 //
+// The -x flag prints commands as they are executed. This is useful for
+// debugging version control commands when a module is downloaded directly
+// from a repository.
+//
 // For more about modules, see https://golang.org/ref/mod.
 //
 // For more about specifying packages, see 'go help packages'.
index d7f2eb46107cf568259be59c59f93a773ac8ccb7..5981e5ecdbeb6c391dee10cded5ffaf01a3714d4 100644 (file)
@@ -38,7 +38,7 @@ Generate runs commands described by directives within existing
 files. Those commands can run any process but the intent is to
 create or update Go source files.
 
-Go generate is never run automatically by go build, go get, go test,
+Go generate is never run automatically by go build, go test,
 and so on. It must be run explicitly.
 
 Go generate scans the file for directives, which are lines of
index 4d87d2670da81e201e2b9238a4eb857a83ed7719..c63451207218d46149d0d342fc131270a1655b75 100644 (file)
@@ -83,8 +83,7 @@ current directory. For example:
 
 See 'go help install' or https://golang.org/ref/mod#go-install for details.
 
-In addition to build flags (listed in 'go help build') 'go get' accepts the
-following flags.
+'go get' accepts the following flags.
 
 The -t flag instructs get to consider modules needed to build tests of
 packages specified on the command line.
@@ -99,6 +98,10 @@ but changes the default to select patch releases.
 When the -t and -u flags are used together, get will update
 test dependencies as well.
 
+The -x flag prints commands as they are executed. This is useful for
+debugging version control commands when a module is downloaded directly
+from a repository.
+
 For more about modules, see https://golang.org/ref/mod.
 
 For more about specifying packages, see 'go help packages'.