add("git", lazyBool("the 'git' executable exists and provides the standard CLI", hasWorkingGit))
add("GODEBUG", script.PrefixCondition("GODEBUG contains <suffix>", hasGodebug))
add("GOEXPERIMENT", script.PrefixCondition("GOEXPERIMENT <suffix> is enabled", hasGoexperiment))
+ add("go-builder", script.BoolCondition("GO_BUILDER_NAME is non-empty", testenv.Builder() != ""))
add("link", lazyBool("testenv.HasLink()", testenv.HasLink))
add("mismatched-goroot", script.Condition("test's GOROOT_FINAL does not match the real GOROOT", isMismatchedGoroot))
add("msan", sysCondition("-msan", platform.MSanSupported, true))
GOOS/GOARCH supports -fuzz with instrumentation
[git]
the 'git' executable exists and provides the standard CLI
+[go-builder]
+ GO_BUILDER_NAME is non-empty
[link]
testenv.HasLink()
[mismatched-goroot]
# Test a real GOTOOLCHAIN
[short] skip
[!net:golang.org] skip
+[!net:sum.golang.org] skip
[!GOOS:darwin] [!GOOS:windows] [!GOOS:linux] skip
[!GOARCH:amd64] [!GOARCH:arm64] skip
env GOPROXY=
-env GOSUMDB=
+[go-builder] env GOSUMDB=
+[!go-builder] env GOSUMDB=sum.golang.org # Set explicitly in case GOROOT/go.env is modified.
env GOTOOLCHAIN=go1.20.1
# Avoid resolving a "go1.20.1" from the user's real $PATH.
-[!net:golang.org] skip
+[!net:proxy.golang.org] skip
-env GOPROXY=
+ # In the Go project's official release GOPROXY defaults to proxy.golang.org,
+ # but it may be changed in GOROOT/go.env (such as in third-party
+ # distributions).
+ #
+ # Make sure it is in use here, because the server for releases not served
+ # through the proxy (https://golang.org/toolchain?go-get=1) currently only
+ # serves the latest patch release for each of the supported stable releases.
+
+[go-builder] env GOPROXY=
+[!go-builder] env GOPROXY=https://proxy.golang.org
go list -m -versions go
stdout 1.20.1 # among others
env GOSUMDB=
# github.com/russross/blackfriday v2.0.0+incompatible exists,
-# and should be resolved if we ask for v2.0 explicitly.
+# and should be resolved if we ask for it explicitly.
-go list -m github.com/russross/blackfriday@v2.0
+go list -m github.com/russross/blackfriday@v2.0.0+incompatible
stdout '^github.com/russross/blackfriday v2\.0\.0\+incompatible$'
# blackfriday v1.5.2 has a go.mod file, so v1.5.2 should be preferred over
! go list -m github.com/russross/blackfriday@patch
stderr '^go: github.com/russross/blackfriday@patch: can''t query version "patch" of module github.com/russross/blackfriday: no existing version is required$'
+
# If we're fetching directly from version control, ignored +incompatible
# versions should also be omitted by 'go list'.
[!git] stop
env GOPROXY=direct
-go list -versions -m github.com/russross/blackfriday github.com/russross/blackfriday
+go list -versions -m github.com/russross/blackfriday
stdout '^github.com/russross/blackfriday v1\.5\.1 v1\.5\.2' # and possibly others
! stdout ' v2\.'
+# For this module, v2.1.0 exists and has a go.mod file.
+# 'go list -m github.com/russross/blackfriday@v2.0' will check
+# the latest v2.0 tag, discover that it isn't the right module, and stop there
+# (instead of spending the time to check O(N) previous tags).
+
+! go list -m github.com/russross/blackfriday@v2.0
+stderr '^go: module github.com/russross/blackfriday: no matching versions for query "v2\.0\"'
+
+# (But asking for exactly v2.0.0+incompatible should still succeed.)
+go list -m github.com/russross/blackfriday@v2.0.0+incompatible
+stdout '^github.com/russross/blackfriday v2\.0\.0\+incompatible$'
+
+
# However, if the latest compatible version does not include a go.mod file,
# +incompatible versions should still be listed, as they may still reflect the
# intent of the module author.
[!net:proxy.golang.org] skip
+[!net:sum.golang.org] skip
env GO111MODULE=on
-env GOSUMDB=
+[go-builder] env GOSUMDB=
+[!go-builder] env GOSUMDB=sum.golang.org # Set explicitly in case GOROOT/go.env is modified.
env GOPATH=$WORK/gopath1
# With a file-based proxy with an empty checksum directory,
# Test default GOPROXY and GOSUMDB
-env GOPROXY=
-env GOSUMDB=
-go env GOPROXY
-stdout '^https://proxy.golang.org,direct$'
-go env GOSUMDB
-stdout '^sum.golang.org$'
-env GOPROXY=https://proxy.golang.org
-go env GOSUMDB
-stdout '^sum.golang.org$'
+[go-builder] env GOPROXY=
+[go-builder] env GOSUMDB=
+[go-builder] go env GOPROXY
+[go-builder] stdout '^https://proxy.golang.org,direct$'
+[go-builder] go env GOSUMDB
+[go-builder] stdout '^sum.golang.org$'
+[go-builder] env GOPROXY=https://proxy.golang.org
+[go-builder] go env GOSUMDB
+[go-builder] stdout '^sum.golang.org$'
# Download direct from github.
# files not listed in go.sum.
go clean -modcache
-env GOSUMDB=
-env GOPROXY=
+env GOSUMDB=sum.golang.org
+env GOPROXY=https://proxy.golang.org,direct
go list -x -m all # Download go.mod files.
! stderr github