File tree 2 files changed +38
-3
lines changed
src/cmd/go/testdata/script 2 files changed +38
-3
lines changed Original file line number Diff line number Diff line change @@ -2,13 +2,24 @@ env GO111MODULE=off
2
2
3
3
[!gc] skip
4
4
5
- # listing GOROOT should only find standard packages
5
+ # Listing GOROOT should only find standard packages.
6
6
cd $GOROOT/src
7
7
go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}' ./...
8
8
! stdout .
9
9
# TODO: ignore _/blah/go/src in output
10
10
11
- # our vendored packages should be reported as standard
12
- go list std cmd
11
+ # Standard packages should include cmd, but not cmd/vendor.
12
+ go list ./...
13
+ stdout cmd/compile
14
+ ! stdout vendor/golang.org
15
+ ! stdout cmd/vendor
16
+
17
+ # In GOPATH mode, packages vendored into GOROOT should be reported as standard.
18
+ go list -f '{{if .Standard}}{{.ImportPath}}{{end}}' std cmd
13
19
stdout internal/x/net/http2/hpack
14
20
stdout cmd/vendor/golang\.org/x/arch/x86/x86asm
21
+
22
+ # However, vendored packages should not match wildcard patterns beginning with cmd.
23
+ go list cmd/...
24
+ stdout cmd/compile
25
+ ! stdout cmd/vendor
Original file line number Diff line number Diff line change
1
+ env GO111MODULE=off
2
+
3
+ [!gc] skip
4
+
5
+ # 'go list' should report imports from _test.go in the TestImports field.
6
+ go list -f '{{.TestImports}}'
7
+ stdout net/http # from .TestImports
8
+
9
+ # 'go list -test' should report vendored transitive dependencies of _test.go
10
+ # imports in the Deps field, with a 'vendor' prefix on their import paths.
11
+ go list -test -f '{{.Deps}}'
12
+ stdout internal/x/crypto # dep of .TestImports
13
+
14
+ -- go.mod --
15
+ module m
16
+
17
+ -- x.go --
18
+ package x
19
+
20
+ -- x_test.go --
21
+ package x
22
+ import "testing"
23
+ import _ "net/http"
24
+ func Test(t *testing.T) {}
You can’t perform that action at this time.
0 commit comments