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

     1  [short] skip
     2  
     3  # go list with path to directory should work
     4  
     5  env GO111MODULE=off
     6  go list -f '{{.ImportPath}}' $GOROOT/src/math
     7  stdout ^math$
     8  
     9  env GO111MODULE=on
    10  go list -f '{{.ImportPath}}' $GOROOT/src/math
    11  stdout ^math$
    12  go list -f '{{.ImportPath}}' .
    13  stdout ^x$
    14  ! go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/quote@v1.5.2
    15  stderr '^can.t load package: package '$WORK'[/\\]gopath[/\\]pkg[/\\]mod[/\\]rsc.io[/\\]quote@v1.5.2: can only use path@version syntax with .go get.'
    16  
    17  go list -e -f '{{with .Error}}{{.}}{{end}}' $GOPATH/pkg/mod/rsc.io/quote@v1.5.2
    18  stdout '^package '$WORK'[/\\]gopath[/\\]pkg[/\\]mod[/\\]rsc.io[/\\]quote@v1.5.2: can only use path@version syntax with .go get.'
    19  go mod download rsc.io/quote@v1.5.2
    20  go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/quote@v1.5.2
    21  stdout '^rsc.io/quote$'
    22  go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/sampler@v1.3.0
    23  stdout '^rsc.io/sampler$'
    24  go get -d rsc.io/sampler@v1.3.1
    25  go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/sampler@v1.3.1
    26  stdout '^rsc.io/sampler$'
    27  ! go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/sampler@v1.3.0
    28  stderr 'outside available modules'
    29  
    30  -- go.mod --
    31  module x
    32  require rsc.io/quote v1.5.2
    33  
    34  -- x.go --
    35  package x