...
1# Ensures that we can correctly list package patterns ending in '.go'.
2# See golang.org/issue/34653.
3
4# A single pattern for a package ending in '.go'.
5go list ./foo.go
6stdout '^test/foo.go$'
7
8# Multiple patterns for packages including one ending in '.go'.
9go list ./bar ./foo.go
10stdout '^test/bar$'
11stdout '^test/foo.go$'
12
13# A single pattern for a Go file.
14go list ./a.go
15stdout '^command-line-arguments$'
16
17# A single typo-ed pattern for a Go file. This should
18# treat the wrong pattern as if it were a package.
19! go list ./foo.go/b.go
20stderr '^stat .*[/\\]foo\.go[/\\]b\.go: directory not found$'
21
22# Multiple patterns for Go files with a typo. This should
23# treat the wrong pattern as if it were a nonexistent file.
24! go list ./foo.go/a.go ./foo.go/b.go
25[GOOS:plan9] stderr 'stat ./foo.go/b.go: ''./foo.go/b.go'' does not exist'
26[GOOS:windows] stderr './foo.go/b.go: The system cannot find the file specified'
27[!GOOS:plan9] [!GOOS:windows] stderr './foo.go/b.go: no such file or directory'
28
29-- a.go --
30package main
31-- bar/a.go --
32package bar
33-- foo.go/a.go --
34package foo.go
35-- go.mod --
36module "test"
37
38go 1.13
View as plain text