cmd/go: update urls in documentation to go.dev

Update the urls in user facing documentation
and error messages to consistently use go.dev
instead of golang.org

Change-Id: I48866eb03036221035bcf204a892d9a3b4c214bb
Reviewed-on: https://go-review.googlesource.com/c/go/+/754460
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Reviewed-by: Jonathan Amsterdam <jba@google.com>
This commit is contained in:
Sean Liao
2026-03-11 19:51:44 +00:00
committed by Michael Matloob
parent 105b1e2757
commit 75fdbda517
22 changed files with 83 additions and 83 deletions

View File

@@ -199,7 +199,7 @@
// By default, if a vendor directory is present and the go version in go.mod
// is 1.14 or higher, the go command acts as if -mod=vendor were set.
// Otherwise, the go command acts as if -mod=readonly were set.
// See https://golang.org/ref/mod#build-commands for details.
// See https://go.dev/ref/mod#build-commands for details.
// -modcacherw
// leave newly-created directories in the module cache read-write
// instead of making them read-only.
@@ -714,7 +714,7 @@
//
// go get toolchain@patch
//
// See https://golang.org/ref/mod#go-get for details.
// See https://go.dev/ref/mod#go-get for details.
//
// In earlier versions of Go, 'go get' was used to build and install packages.
// Now, 'go get' is dedicated to adjusting dependencies in go.mod. 'go install'
@@ -725,7 +725,7 @@
// go install example.com/pkg@v1.2.3
// go install example.com/pkg@latest
//
// See 'go help install' or https://golang.org/ref/mod#go-install for details.
// See 'go help install' or https://go.dev/ref/mod#go-install for details.
//
// 'go get' accepts the following flags.
//
@@ -751,7 +751,7 @@
//
// For more about build flags, see 'go help build'.
//
// For more about modules, see https://golang.org/ref/mod.
// For more about modules, see https://go.dev/ref/mod.
//
// For more about using 'go get' to update the minimum Go version and
// suggested Go toolchain, see https://go.dev/doc/toolchain.
@@ -1130,7 +1130,7 @@
//
// For more about specifying packages, see 'go help packages'.
//
// For more about modules, see https://golang.org/ref/mod.
// For more about modules, see https://go.dev/ref/mod.
//
// # Module maintenance
//
@@ -1208,9 +1208,9 @@
//
// The -x flag causes download to print the commands download executes.
//
// See https://golang.org/ref/mod#go-mod-download for more about 'go mod download'.
// See https://go.dev/ref/mod#go-mod-download for more about 'go mod download'.
//
// See https://golang.org/ref/mod#version-queries for more about version queries.
// See https://go.dev/ref/mod#version-queries for more about version queries.
//
// # Edit go.mod from tools or scripts
//
@@ -1355,7 +1355,7 @@
//
// Edit also provides the -C, -n, and -x build flags.
//
// See https://golang.org/ref/mod#go-mod-edit for more about 'go mod edit'.
// See https://go.dev/ref/mod#go-mod-edit for more about 'go mod edit'.
//
// # Print module requirement graph
//
@@ -1374,7 +1374,7 @@
//
// The -x flag causes graph to print the commands graph executes.
//
// See https://golang.org/ref/mod#go-mod-graph for more about 'go mod graph'.
// See https://go.dev/ref/mod#go-mod-graph for more about 'go mod graph'.
//
// # Initialize new module in current directory
//
@@ -1390,7 +1390,7 @@
// module path argument is omitted, init will attempt to infer the module path
// using import comments in .go files and the current directory (if in GOPATH).
//
// See https://golang.org/ref/mod#go-mod-init for more about 'go mod init'.
// See https://go.dev/ref/mod#go-mod-init for more about 'go mod init'.
//
// # Add missing and remove unused modules
//
@@ -1430,7 +1430,7 @@
//
// The -x flag causes tidy to print the commands download executes.
//
// See https://golang.org/ref/mod#go-mod-tidy for more about 'go mod tidy'.
// See https://go.dev/ref/mod#go-mod-tidy for more about 'go mod tidy'.
//
// # Make vendored copy of dependencies
//
@@ -1453,7 +1453,7 @@
// named "vendor" within the module root directory, so this flag is
// primarily useful for other tools.
//
// See https://golang.org/ref/mod#go-mod-vendor for more about 'go mod vendor'.
// See https://go.dev/ref/mod#go-mod-vendor for more about 'go mod vendor'.
//
// # Verify dependencies have expected content
//
@@ -1468,7 +1468,7 @@
// modules have been changed and causes 'go mod' to exit with a
// non-zero status.
//
// See https://golang.org/ref/mod#go-mod-verify for more about 'go mod verify'.
// See https://go.dev/ref/mod#go-mod-verify for more about 'go mod verify'.
//
// # Explain why packages or modules are needed
//
@@ -1505,7 +1505,7 @@
// (main module does not need package golang.org/x/text/encoding)
// $
//
// See https://golang.org/ref/mod#go-mod-why for more about 'go mod why'.
// See https://go.dev/ref/mod#go-mod-why for more about 'go mod why'.
//
// # Workspace maintenance
//
@@ -2394,7 +2394,7 @@
// GO111MODULE
// Controls whether the go command runs in module-aware mode or GOPATH mode.
// May be "off", "on", or "auto".
// See https://golang.org/ref/mod#mod-commands.
// See https://go.dev/ref/mod#mod-commands.
// GOARCH
// The architecture, or processor, for which to compile code.
// Examples are amd64, 386, arm, ppc64.
@@ -2443,15 +2443,15 @@
// Comma-separated list of glob patterns (in the syntax of Go's path.Match)
// of module path prefixes that should always be fetched directly
// or that should not be compared against the checksum database.
// See https://golang.org/ref/mod#private-modules.
// See https://go.dev/ref/mod#private-modules.
// GOPROXY
// URL of Go module proxy. See https://golang.org/ref/mod#environment-variables
// and https://golang.org/ref/mod#module-proxy for details.
// URL of Go module proxy. See https://go.dev/ref/mod#environment-variables
// and https://go.dev/ref/mod#module-proxy for details.
// GOROOT
// The root of the go tree.
// GOSUMDB
// The name of checksum database to use and optionally its public key and
// URL. See https://golang.org/ref/mod#authenticating.
// URL. See https://go.dev/ref/mod#authenticating.
// GOTMPDIR
// Temporary directory used by the go command and testing package.
// Overrides the platform-specific temporary directory such as "/tmp".
@@ -2519,7 +2519,7 @@
// GOAMD64
// For GOARCH=amd64, the microarchitecture level for which to compile.
// Valid values are v1 (default), v2, v3, v4.
// See https://golang.org/wiki/MinimumRequirements#amd64
// See https://go.dev/wiki/MinimumRequirements#amd64
// GOARM
// For GOARCH=arm, the ARM architecture for which to compile.
// Valid values are 5, 6, 7.
@@ -2725,22 +2725,22 @@
// marking the root of the main (current) module.
//
// The go.mod file format is described in detail at
// https://golang.org/ref/mod#go-mod-file.
// https://go.dev/ref/mod#go-mod-file.
//
// To create a new go.mod file, use 'go mod init'. For details see
// 'go help mod init' or https://golang.org/ref/mod#go-mod-init.
// 'go help mod init' or https://go.dev/ref/mod#go-mod-init.
//
// To add missing module requirements or remove unneeded requirements,
// use 'go mod tidy'. For details, see 'go help mod tidy' or
// https://golang.org/ref/mod#go-mod-tidy.
// https://go.dev/ref/mod#go-mod-tidy.
//
// To add, upgrade, downgrade, or remove a specific module requirement, use
// 'go get'. For details, see 'go help module-get' or
// https://golang.org/ref/mod#go-get.
// https://go.dev/ref/mod#go-get.
//
// To make other changes or to parse go.mod as JSON for use by other tools,
// use 'go mod edit'. See 'go help mod edit' or
// https://golang.org/ref/mod#go-mod-edit.
// https://go.dev/ref/mod#go-mod-edit.
//
// # GOPATH environment variable
//
@@ -2780,7 +2780,7 @@
// The first element of this list is used to set the default module cache and
// binary install directory locations as described above.
//
// See https://golang.org/wiki/SettingGOPATH to set a custom GOPATH.
// See https://go.dev/wiki/SettingGOPATH to set a custom GOPATH.
//
// Each directory listed in GOPATH must have a prescribed structure:
//
@@ -2828,7 +2828,7 @@
// but new packages are always downloaded into the first directory
// in the list.
//
// See https://golang.org/doc/code.html for an example.
// See https://go.dev/doc/code.html for an example.
//
// # GOPATH mode vendor directories
//
@@ -2883,7 +2883,7 @@
// can be a module proxy.
//
// For details on the GOPROXY protocol, see
// https://golang.org/ref/mod#goproxy-protocol.
// https://go.dev/ref/mod#goproxy-protocol.
//
// # Import path syntax
//
@@ -2919,7 +2919,7 @@
// "example.com/m/foo/quux" can all import "foo/internal/baz", but the package
// "example.com/m/crash/bang" cannot.
//
// See https://golang.org/s/go14internal for details.
// See https://go.dev/s/go14internal for details.
//
// # Fully-qualified import paths
//
@@ -3052,7 +3052,7 @@
// at https://code.org/r/p/exproj
//
// Downloaded modules are stored in the module cache.
// See https://golang.org/ref/mod#module-cache.
// See https://go.dev/ref/mod#module-cache.
//
// An additional variant of the go-import meta tag is
// recognized and is preferred over those listing version control systems.
@@ -3062,7 +3062,7 @@
//
// This tag means to fetch modules with paths beginning with example.org
// from the module proxy available at the URL https://code.org/moduleproxy.
// See https://golang.org/ref/mod#goproxy-protocol for details about the
// See https://go.dev/ref/mod#goproxy-protocol for details about the
// proxy protocol.
//
// # Modules, module versions, and more
@@ -3074,9 +3074,9 @@
// repositories or from module proxy servers.
//
// For a series of tutorials on modules, see
// https://golang.org/doc/tutorial/create-module.
// https://go.dev/doc/tutorial/create-module.
//
// For a detailed reference on modules, see https://golang.org/ref/mod.
// For a detailed reference on modules, see https://go.dev/ref/mod.
//
// By default, the go command may download modules from https://proxy.golang.org.
// It may authenticate modules using the checksum database at
@@ -3087,7 +3087,7 @@
//
// The go command's download behavior may be configured using GOPROXY, GOSUMDB,
// GOPRIVATE, and other environment variables. See 'go help environment'
// and https://golang.org/ref/mod#private-module-privacy for more information.
// and https://go.dev/ref/mod#private-module-privacy for more information.
//
// # Module authentication using go.sum
//
@@ -3098,7 +3098,7 @@
// may also be downloaded from the checksum database depending on the values of
// GOSUMDB, GOPRIVATE, and GONOSUMDB.
//
// For details, see https://golang.org/ref/mod#authenticating.
// For details, see https://go.dev/ref/mod#authenticating.
//
// # Package lists and patterns
//
@@ -3245,7 +3245,7 @@
// The 'go env -w' command (see 'go help env') can be used to set these variables
// for future go command invocations.
//
// For more details, see https://golang.org/ref/mod#private-modules.
// For more details, see https://go.dev/ref/mod#private-modules.
//
// # Testing flags
//

View File

@@ -178,7 +178,7 @@ import statement can only appear in packages with the import path prefix
"example.com/m/foo/quux" can all import "foo/internal/baz", but the package
"example.com/m/crash/bang" cannot.
See https://golang.org/s/go14internal for details.
See https://go.dev/s/go14internal for details.
Fully-qualified import paths
@@ -311,7 +311,7 @@ tag and then download the code from the "foo/subdir" subdirectory within the Git
at https://code.org/r/p/exproj
Downloaded modules are stored in the module cache.
See https://golang.org/ref/mod#module-cache.
See https://go.dev/ref/mod#module-cache.
An additional variant of the go-import meta tag is
recognized and is preferred over those listing version control systems.
@@ -321,7 +321,7 @@ That variant uses "mod" as the vcs in the content value, as in:
This tag means to fetch modules with paths beginning with example.org
from the module proxy available at the URL https://code.org/moduleproxy.
See https://golang.org/ref/mod#goproxy-protocol for details about the
See https://go.dev/ref/mod#goproxy-protocol for details about the
proxy protocol.
`,
}
@@ -366,7 +366,7 @@ On Plan 9, the value is a list.
The first element of this list is used to set the default module cache and
binary install directory locations as described above.
See https://golang.org/wiki/SettingGOPATH to set a custom GOPATH.
See https://go.dev/wiki/SettingGOPATH to set a custom GOPATH.
Each directory listed in GOPATH must have a prescribed structure:
@@ -414,7 +414,7 @@ Go searches each directory listed in GOPATH to find source code,
but new packages are always downloaded into the first directory
in the list.
See https://golang.org/doc/code.html for an example.
See https://go.dev/doc/code.html for an example.
GOPATH mode vendor directories
@@ -487,7 +487,7 @@ General-purpose environment variables:
GO111MODULE
Controls whether the go command runs in module-aware mode or GOPATH mode.
May be "off", "on", or "auto".
See https://golang.org/ref/mod#mod-commands.
See https://go.dev/ref/mod#mod-commands.
GOARCH
The architecture, or processor, for which to compile code.
Examples are amd64, 386, arm, ppc64.
@@ -536,15 +536,15 @@ General-purpose environment variables:
Comma-separated list of glob patterns (in the syntax of Go's path.Match)
of module path prefixes that should always be fetched directly
or that should not be compared against the checksum database.
See https://golang.org/ref/mod#private-modules.
See https://go.dev/ref/mod#private-modules.
GOPROXY
URL of Go module proxy. See https://golang.org/ref/mod#environment-variables
and https://golang.org/ref/mod#module-proxy for details.
URL of Go module proxy. See https://go.dev/ref/mod#environment-variables
and https://go.dev/ref/mod#module-proxy for details.
GOROOT
The root of the go tree.
GOSUMDB
The name of checksum database to use and optionally its public key and
URL. See https://golang.org/ref/mod#authenticating.
URL. See https://go.dev/ref/mod#authenticating.
GOTMPDIR
Temporary directory used by the go command and testing package.
Overrides the platform-specific temporary directory such as "/tmp".
@@ -612,7 +612,7 @@ Architecture-specific environment variables:
GOAMD64
For GOARCH=amd64, the microarchitecture level for which to compile.
Valid values are v1 (default), v2, v3, v4.
See https://golang.org/wiki/MinimumRequirements#amd64
See https://go.dev/wiki/MinimumRequirements#amd64
GOARM
For GOARCH=arm, the ARM architecture for which to compile.
Valid values are 5, 6, 7.

View File

@@ -339,7 +339,7 @@ For more about build flags, see 'go help build'.
For more about specifying packages, see 'go help packages'.
For more about modules, see https://golang.org/ref/mod.
For more about modules, see https://go.dev/ref/mod.
`,
}

View File

@@ -71,9 +71,9 @@ useful on systems that do not preserve the module cache.
The -x flag causes download to print the commands download executes.
See https://golang.org/ref/mod#go-mod-download for more about 'go mod download'.
See https://go.dev/ref/mod#go-mod-download for more about 'go mod download'.
See https://golang.org/ref/mod#version-queries for more about version queries.
See https://go.dev/ref/mod#version-queries for more about version queries.
`,
}

View File

@@ -166,7 +166,7 @@ use 'go list -m -json all'.
Edit also provides the -C, -n, and -x build flags.
See https://golang.org/ref/mod#go-mod-edit for more about 'go mod edit'.
See https://go.dev/ref/mod#go-mod-edit for more about 'go mod edit'.
`,
}

View File

@@ -35,7 +35,7 @@ in the go.mod file.
The -x flag causes graph to print the commands graph executes.
See https://golang.org/ref/mod#go-mod-graph for more about 'go mod graph'.
See https://go.dev/ref/mod#go-mod-graph for more about 'go mod graph'.
`,
Run: runGraph,
}

View File

@@ -24,7 +24,7 @@ Init accepts one optional argument, the module path for the new module. If the
module path argument is omitted, init will attempt to infer the module path
using import comments in .go files and the current directory (if in GOPATH).
See https://golang.org/ref/mod#go-mod-init for more about 'go mod init'.
See https://go.dev/ref/mod#go-mod-init for more about 'go mod init'.
`,
Run: runInit,
}

View File

@@ -55,7 +55,7 @@ file.
The -x flag causes tidy to print the commands download executes.
See https://golang.org/ref/mod#go-mod-tidy for more about 'go mod tidy'.
See https://go.dev/ref/mod#go-mod-tidy for more about 'go mod tidy'.
`,
Run: runTidy,
}

View File

@@ -49,7 +49,7 @@ path instead of "vendor". The go command can only use a vendor directory
named "vendor" within the module root directory, so this flag is
primarily useful for other tools.
See https://golang.org/ref/mod#go-mod-vendor for more about 'go mod vendor'.
See https://go.dev/ref/mod#go-mod-vendor for more about 'go mod vendor'.
`,
Run: runVendor,
}

View File

@@ -33,7 +33,7 @@ verify prints "all modules verified." Otherwise it reports which
modules have been changed and causes 'go mod' to exit with a
non-zero status.
See https://golang.org/ref/mod#go-mod-verify for more about 'go mod verify'.
See https://go.dev/ref/mod#go-mod-verify for more about 'go mod verify'.
`,
Run: runVerify,
}

View File

@@ -47,7 +47,7 @@ For example:
(main module does not need package golang.org/x/text/encoding)
$
See https://golang.org/ref/mod#go-mod-why for more about 'go mod why'.
See https://go.dev/ref/mod#go-mod-why for more about 'go mod why'.
`,
}

View File

@@ -267,7 +267,7 @@ func (r *gitRepo) loadRefs(ctx context.Context) (map[string]string, error) {
if gitErr != nil {
if rerr, ok := gitErr.(*RunError); ok {
if bytes.Contains(rerr.Stderr, []byte("fatal: could not read Username")) {
rerr.HelpText = "Confirm the import path was entered correctly.\nIf this is a private repository, see https://golang.org/doc/faq#git_https for additional information."
rerr.HelpText = "Confirm the import path was entered correctly.\nIf this is a private repository, see https://go.dev/doc/faq#git_https for additional information."
}
}

View File

@@ -1101,7 +1101,7 @@ hashes are stored in a file in the module root directory named go.sum. Hashes
may also be downloaded from the checksum database depending on the values of
GOSUMDB, GOPRIVATE, and GONOSUMDB.
For details, see https://golang.org/ref/mod#authenticating.
For details, see https://go.dev/ref/mod#authenticating.
`,
}
@@ -1146,6 +1146,6 @@ instead of module paths.
The 'go env -w' command (see 'go help env') can be used to set these variables
for future go command invocations.
For more details, see https://golang.org/ref/mod#private-modules.
For more details, see https://go.dev/ref/mod#private-modules.
`,
}

View File

@@ -37,7 +37,7 @@ a site serving from a fixed file system (including a file:/// URL)
can be a module proxy.
For details on the GOPROXY protocol, see
https://golang.org/ref/mod#goproxy-protocol.
https://go.dev/ref/mod#goproxy-protocol.
`,
}

View File

@@ -81,7 +81,7 @@ To upgrade the Go toolchain to the latest patch release of the current Go toolch
go get toolchain@patch
See https://golang.org/ref/mod#go-get for details.
See https://go.dev/ref/mod#go-get for details.
In earlier versions of Go, 'go get' was used to build and install packages.
Now, 'go get' is dedicated to adjusting dependencies in go.mod. 'go install'
@@ -92,7 +92,7 @@ current directory. For example:
go install example.com/pkg@v1.2.3
go install example.com/pkg@latest
See 'go help install' or https://golang.org/ref/mod#go-install for details.
See 'go help install' or https://go.dev/ref/mod#go-install for details.
'go get' accepts the following flags.
@@ -118,7 +118,7 @@ from a repository.
For more about build flags, see 'go help build'.
For more about modules, see https://golang.org/ref/mod.
For more about modules, see https://go.dev/ref/mod.
For more about using 'go get' to update the minimum Go version and
suggested Go toolchain, see https://go.dev/doc/toolchain.
@@ -320,7 +320,7 @@ func runGet(ctx context.Context, cmd *base.Command, args []string) {
"\t'go get' is no longer supported outside a module.\n" +
"\tTo build and install a command, use 'go install' with a version,\n" +
"\tlike 'go install example.com/cmd@latest'\n" +
"\tFor more information, see https://golang.org/doc/go-get-install-deprecation\n" +
"\tFor more information, see https://go.dev/doc/go-get-install-deprecation\n" +
"\tor run 'go help get' or 'go help install'.")
}

View File

@@ -17,9 +17,9 @@ distributed together. Modules may be downloaded directly from version control
repositories or from module proxy servers.
For a series of tutorials on modules, see
https://golang.org/doc/tutorial/create-module.
https://go.dev/doc/tutorial/create-module.
For a detailed reference on modules, see https://golang.org/ref/mod.
For a detailed reference on modules, see https://go.dev/ref/mod.
By default, the go command may download modules from https://proxy.golang.org.
It may authenticate modules using the checksum database at
@@ -30,7 +30,7 @@ respectively.
The go command's download behavior may be configured using GOPROXY, GOSUMDB,
GOPRIVATE, and other environment variables. See 'go help environment'
and https://golang.org/ref/mod#private-module-privacy for more information.
and https://go.dev/ref/mod#private-module-privacy for more information.
`,
}
@@ -44,21 +44,21 @@ directory and then successive parent directories to find the go.mod
marking the root of the main (current) module.
The go.mod file format is described in detail at
https://golang.org/ref/mod#go-mod-file.
https://go.dev/ref/mod#go-mod-file.
To create a new go.mod file, use 'go mod init'. For details see
'go help mod init' or https://golang.org/ref/mod#go-mod-init.
'go help mod init' or https://go.dev/ref/mod#go-mod-init.
To add missing module requirements or remove unneeded requirements,
use 'go mod tidy'. For details, see 'go help mod tidy' or
https://golang.org/ref/mod#go-mod-tidy.
https://go.dev/ref/mod#go-mod-tidy.
To add, upgrade, downgrade, or remove a specific module requirement, use
'go get'. For details, see 'go help module-get' or
https://golang.org/ref/mod#go-get.
https://go.dev/ref/mod#go-get.
To make other changes or to parse go.mod as JSON for use by other tools,
use 'go mod edit'. See 'go help mod edit' or
https://golang.org/ref/mod#go-mod-edit.
https://go.dev/ref/mod#go-mod-edit.
`,
}

View File

@@ -2159,7 +2159,7 @@ func (ld *packageLoader) checkTidyCompatibility(loaderstate *State, ctx context.
for _, m := range ld.requirements.rootModules {
if v := mg.Selected(m.Path); v != m.Version {
fmt.Fprintln(os.Stderr)
base.Fatalf("go: internal error: failed to diagnose selected-version mismatch for module %s: go %s selects %s, but go %s selects %s\n\tPlease report this at https://golang.org/issue.", m.Path, goVersion, m.Version, compatVersion, v)
base.Fatalf("go: internal error: failed to diagnose selected-version mismatch for module %s: go %s selects %s, but go %s selects %s\n\tPlease report this at https://go.dev/issue.", m.Path, goVersion, m.Version, compatVersion, v)
}
}
return

View File

@@ -491,7 +491,7 @@ func (v *Cmd) run1(dir string, cmdline string, keyval []string, verbose bool) ([
_, err := pathcache.LookPath(v.Cmd)
if err != nil {
fmt.Fprintf(os.Stderr,
"go: missing %s command. See https://golang.org/s/gogetcmd\n",
"go: missing %s command. See https://go.dev/s/gogetcmd\n",
v.Name)
return nil, err
}

View File

@@ -155,7 +155,7 @@ and test commands:
By default, if a vendor directory is present and the go version in go.mod
is 1.14 or higher, the go command acts as if -mod=vendor were set.
Otherwise, the go command acts as if -mod=readonly were set.
See https://golang.org/ref/mod#build-commands for details.
See https://go.dev/ref/mod#build-commands for details.
-modcacherw
leave newly-created directories in the module cache read-write
instead of making them read-only.

View File

@@ -57,7 +57,7 @@ cd ..
env PATH=
env path=
! go build -buildvcs -o example.exe .
stderr 'go: missing Git command\. See https://golang\.org/s/gogetcmd$'
stderr 'go: missing Git command\. See https://go\.dev/s/gogetcmd$'
# ...but by default we should omit VCS metadata when the tool is missing.

View File

@@ -15,7 +15,7 @@ stdout 'Go Gopher'
! go mod download github.com/golang/nonexist@latest
stderr 'Confirm the import path was entered correctly.'
stderr 'If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.'
stderr 'If this is a private repository, see https://go.dev/doc/faq#git_https for additional information.'
! stdout .
# Fetching a nonexistent commit should return an "unknown revision"
@@ -26,7 +26,7 @@ stderr '^go: github.com/golang/term@86186f3aba07ed0212cfb944f3398997d2d07c6b: in
! go mod download github.com/golang/nonexist@master
stderr '^Confirm the import path was entered correctly.$'
stderr '^If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.$'
stderr '^If this is a private repository, see https://go.dev/doc/faq#git_https for additional information.$'
! stderr 'unknown revision'
! stdout .

View File

@@ -31,11 +31,11 @@ go test -c -o $devnull .
# When listing a main package, in general we need its VCS metadata to determine
# the .Stale and .StaleReason fields.
! go list -buildvcs=true .
stderr '^go: missing Git command\. See https://golang\.org/s/gogetcmd\nerror obtaining VCS status: .*\n\tUse -buildvcs=false to disable VCS stamping.'
stderr '^go: missing Git command\. See https://go\.dev/s/gogetcmd\nerror obtaining VCS status: .*\n\tUse -buildvcs=false to disable VCS stamping.'
# Adding the -test flag should be strictly additive — it should not suppress the error.
! go list -buildvcs=true -test .
stderr '^go: missing Git command\. See https://golang\.org/s/gogetcmd\nerror obtaining VCS status: .*\n\tUse -buildvcs=false to disable VCS stamping.'
stderr '^go: missing Git command\. See https://go\.dev/s/gogetcmd\nerror obtaining VCS status: .*\n\tUse -buildvcs=false to disable VCS stamping.'
# Adding the suggested flag should suppress the error.
go list -test -buildvcs=false .
@@ -51,9 +51,9 @@ go list -test ./testonly
# Again, setting -buildvcs explicitly should force the use of the VCS tool.
! go list -buildvcs ./testonly
stderr '^go: missing Git command\. See https://golang\.org/s/gogetcmd\nerror obtaining VCS status: .*\n\tUse -buildvcs=false to disable VCS stamping.'
stderr '^go: missing Git command\. See https://go\.dev/s/gogetcmd\nerror obtaining VCS status: .*\n\tUse -buildvcs=false to disable VCS stamping.'
! go list -buildvcs -test ./testonly
stderr '^go: missing Git command\. See https://golang\.org/s/gogetcmd\nerror obtaining VCS status: .*\n\tUse -buildvcs=false to disable VCS stamping.'
stderr '^go: missing Git command\. See https://go\.dev/s/gogetcmd\nerror obtaining VCS status: .*\n\tUse -buildvcs=false to disable VCS stamping.'
-- go.mod --