...

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

Documentation: cmd/go/testdata/script

     1# Issue 46119
     2
     3# When a module is inside a GOPATH workspace, Package.Root should be set to
     4# Module.Dir instead of $GOPATH/src.
     5
     6env GOPATH=$WORK/tmp
     7cd $WORK/tmp/src/test
     8
     9go list -f {{.Root}}
    10stdout ^$PWD$
    11
    12# Were we really inside a GOPATH workspace?
    13env GO111MODULE=off
    14go list -f {{.Root}}
    15stdout ^$WORK/tmp$
    16
    17-- $WORK/tmp/src/test/go.mod --
    18module test
    19
    20-- $WORK/tmp/src/test/main.go --
    21package main
    22
    23func main() {}

View as plain text