...

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

Documentation: cmd/go/testdata/script

     1# Run
     2env GO111MODULE=off
     3cd vend/hello
     4go run hello.go
     5stdout 'hello, world'
     6
     7-- vend/hello/hello.go --
     8package main
     9
    10import (
    11	"fmt"
    12	"strings" // really ../vendor/strings
    13)
    14
    15func main() {
    16	fmt.Printf("%s\n", strings.Msg)
    17}
    18-- vend/hello/hello_test.go --
    19package main
    20
    21import (
    22	"strings" // really ../vendor/strings
    23	"testing"
    24)
    25
    26func 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 --
    32package strings
    33
    34var Msg = "hello, world"

View as plain text