github.com/gagliardetto/golang-go@v0.0.0-20201020153340-53909ea70814/cmd/go/testdata/script/version.txt (about)

     1  env GO111MODULE=on
     2  [short] skip
     3  
     4  # Check that 'go version' and 'go version -m' work on a binary built in module mode.
     5  go build -o fortune.exe rsc.io/fortune
     6  go version fortune.exe
     7  stdout '^fortune.exe: .+'
     8  go version -m fortune.exe
     9  stdout '^\tpath\trsc.io/fortune'
    10  stdout '^\tmod\trsc.io/fortune\tv1.0.0'
    11  
    12  # Repeat the test with -buildmode=pie.
    13  # TODO(golang.org/issue/27144): don't skip after -buildmode=pie is implemented
    14  # on Windows.
    15  [windows] skip # -buildmode=pie not supported
    16  go build -buildmode=pie -o external.exe rsc.io/fortune
    17  go version external.exe
    18  stdout '^external.exe: .+'
    19  go version -m external.exe
    20  stdout '^\tpath\trsc.io/fortune'
    21  stdout '^\tmod\trsc.io/fortune\tv1.0.0'
    22  
    23  -- go.mod --
    24  module m