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

     1  # Run
     2  env GO111MODULE=off
     3  cd vend/hello
     4  go run hello.go
     5  stdout 'hello, world'
     6  
     7  -- vend/hello/hello.go --
     8  package main
     9  
    10  import (
    11  	"fmt"
    12  	"strings" // really ../vendor/strings
    13  )
    14  
    15  func main() {
    16  	fmt.Printf("%s\n", strings.Msg)
    17  }
    18  -- vend/hello/hello_test.go --
    19  package main
    20  
    21  import (
    22  	"strings" // really ../vendor/strings
    23  	"testing"
    24  )
    25  
    26  func TestMsgInternal(t *testing.T) {
    27  	if strings.Msg != "hello, world" {
    28  		t.Fatalf("unexpected msg: %v", strings.Msg)
    29  	}
    30  }
    31  -- vend/vendor/strings/msg.go --
    32  package strings
    33  
    34  var Msg = "hello, world"
    35  

View as plain text