aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/list_gomod_in_gopath.txt
blob: 064f33adc36a69f9c551ca07aece88e1a67e8002 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Issue 46119

# When a module is inside a GOPATH workspace, Package.Root should be set to
# Module.Dir instead of $GOPATH/src.

env GOPATH=$WORK/tmp
cd $WORK/tmp/src/test

go list -f {{.Root}}
stdout ^$PWD$

# Were we really inside a GOPATH workspace?
env GO111MODULE=off
go list -f {{.Root}}
stdout ^$WORK/tmp$

-- $WORK/tmp/src/test/go.mod --
module test

-- $WORK/tmp/src/test/main.go --
package main

func main() {}