...

Text file src/cmd/go/testdata/script/build_cache_disabled.txt

Documentation: cmd/go/testdata/script

     1# The build cache is required to build anything. It also may be needed to
     2# initialize the build system, which is needed for commands like 'go env'.
     3# However, there are lots of commands the cache is not needed for, and we
     4# shouldn't require it when it won't be used.
     5#
     6# TODO(golang.org/issue/39882): commands below should work, too.
     7# * go clean -modcache
     8# * go env
     9# * go fix
    10# * go fmt
    11# * go generate
    12# * go get
    13# * go list (without -export or -compiled)
    14
    15env GOCACHE=off
    16
    17# Commands that don't completely load packages should work.
    18go doc fmt
    19stdout Printf
    20
    21! go tool compile -h
    22stderr usage:
    23
    24go version
    25stdout '^go version'
    26
    27
    28# Module commands that don't load packages should work.
    29go mod init m
    30exists go.mod
    31
    32go mod edit -require rsc.io/quote@v1.5.2
    33
    34go mod download rsc.io/quote
    35
    36go mod graph
    37stdout rsc.io/quote
    38
    39go mod verify
    40
    41
    42# Commands that load but don't build packages should work.
    43go fmt .
    44
    45go doc .
    46
    47-- main.go --
    48package main
    49
    50func main() {}

View as plain text