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

     1  [short] skip
     2  
     3  # go list with path to directory should work
     4  
     5  # populate go.sum
     6  go get
     7  
     8  env GO111MODULE=off
     9  go list -f '{{.ImportPath}}' $GOROOT/src/math
    10  stdout ^math$
    11  
    12  env GO111MODULE=on
    13  go list -f '{{.ImportPath}}' $GOROOT/src/math
    14  stdout ^math$
    15  go list -f '{{.ImportPath}}' .
    16  stdout ^x$
    17  
    18  go mod download rsc.io/quote@v1.5.2
    19  go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/quote@v1.5.2
    20  stdout '^rsc.io/quote$'
    21  go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/sampler@v1.3.0
    22  stdout '^rsc.io/sampler$'
    23  go get rsc.io/sampler@v1.3.1
    24  go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/sampler@v1.3.1
    25  stdout '^rsc.io/sampler$'
    26  ! go list -f '{{.ImportPath}}' $GOPATH/pkg/mod/rsc.io/sampler@v1.3.0
    27  stderr 'outside main module or its selected dependencies'
    28  
    29  -- go.mod --
    30  module x
    31  require rsc.io/quote v1.5.2
    32  
    33  -- x.go --
    34  package x
    35  
    36  import _ "rsc.io/quote"
    37  

View as plain text