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

     1  [short] skip
     2  env GO111MODULE=off
     3  
     4  cd $GOPATH/src/v
     5  go run m.go
     6  go test
     7  go list -f '{{.Imports}}'
     8  stdout 'v/vendor/vendor.org/p'
     9  go list -f '{{.TestImports}}'
    10  stdout 'v/vendor/vendor.org/p'
    11  go get -d
    12  go get -t -d
    13  
    14  [!net] stop
    15  [!exec:git] stop
    16  
    17  cd $GOPATH/src
    18  
    19  # Update
    20  go get 'github.com/rsc/go-get-issue-11864'
    21  go get -u 'github.com/rsc/go-get-issue-11864'
    22  exists github.com/rsc/go-get-issue-11864/vendor
    23  
    24  # get -u
    25  rm $GOPATH
    26  mkdir $GOPATH/src
    27  go get -u 'github.com/rsc/go-get-issue-11864'
    28  exists github.com/rsc/go-get-issue-11864/vendor
    29  
    30  # get -t -u
    31  rm $GOPATH
    32  mkdir $GOPATH/src
    33  go get -t -u 'github.com/rsc/go-get-issue-11864/...'
    34  exists github.com/rsc/go-get-issue-11864/vendor
    35  
    36  # Submodules
    37  rm $GOPATH
    38  mkdir $GOPATH/src
    39  go get -d 'github.com/rsc/go-get-issue-12612'
    40  go get -u -d 'github.com/rsc/go-get-issue-12612'
    41  exists github.com/rsc/go-get-issue-12612/vendor/golang.org/x/crypto/.git
    42  
    43  # Bad vendor (bad/imp)
    44  rm $GOPATH
    45  mkdir $GOPATH/src
    46  ! go get -t -u 'github.com/rsc/go-get-issue-18219/bad/imp'
    47  stderr 'must be imported as'
    48  ! exists github.com/rsc/go-get-issue-11864/vendor
    49  
    50  # Bad vendor (bad/imp2)
    51  rm $GOPATH
    52  mkdir $GOPATH/src
    53  ! go get -t -u 'github.com/rsc/go-get-issue-18219/bad/imp2'
    54  stderr 'must be imported as'
    55  ! exists github.com/rsc/go-get-issue-11864/vendor
    56  
    57  # Bad vendor (bad/imp3)
    58  rm $GOPATH
    59  mkdir $GOPATH/src
    60  ! go get -t -u 'github.com/rsc/go-get-issue-18219/bad/imp3'
    61  stderr 'must be imported as'
    62  ! exists github.com/rsc/go-get-issue-11864/vendor
    63  
    64  # Bad vendor (bad/...)
    65  rm $GOPATH
    66  mkdir $GOPATH/src
    67  ! go get -t -u 'github.com/rsc/go-get-issue-18219/bad/...'
    68  stderr 'must be imported as'
    69  ! exists github.com/rsc/go-get-issue-11864/vendor
    70  
    71  -- v/m.go --
    72  package main
    73  
    74  import (
    75  	"fmt"
    76  	"vendor.org/p"
    77  )
    78  
    79  func main() {
    80  	fmt.Println(p.C)
    81  }
    82  -- v/m_test.go --
    83  package main
    84  import (
    85  	"fmt"
    86  	"testing"
    87  	"vendor.org/p"
    88  )
    89  
    90  func TestNothing(t *testing.T) {
    91  	fmt.Println(p.C)
    92  }
    93  -- v/vendor/vendor.org/p/p.go --
    94  package p
    95  const C = 1
    96  

View as plain text