aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/go/testdata/script/list_std_vendor.txt
blob: 8f27cc1e8d80fa76037b0ef29a454118304d0bc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# https://golang.org/issue/44725: packages in std should have the same
# dependencies regardless of whether they are listed from within or outside
# GOROOT/src.

# Control case: net, viewed from outside the 'std' module,
# should depend on vendor/golang.org/… instead of golang.org/….

go list -deps net
stdout '^vendor/golang.org/x/net'
! stdout '^golang.org/x/net'
cp stdout $WORK/net-deps.txt


# It should still report the same package dependencies when viewed from
# within GOROOT/src.

cd $GOROOT/src

go list -deps net
stdout '^vendor/golang.org/x/net'
! stdout '^golang.org/x/net'
cmp stdout $WORK/net-deps.txt


# However, 'go mod' and 'go get' subcommands should report the original module
# dependencies, not the vendored packages.

[!net] stop

env GOPROXY=
go mod why -m golang.org/x/net
stdout '^# golang.org/x/net\nnet\ngolang.org/x/net'