| 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'. |
| 5 |
go list ./foo.go |
| 6 |
stdout '^test/foo.go$' |
| 7 |
|
| 8 |
# Multiple patterns for packages including one ending in '.go'. |
| 9 |
go list ./bar ./foo.go |
| 10 |
stdout '^test/bar$' |
| 11 |
stdout '^test/foo.go$' |
| 12 |
|
| 13 |
# A single pattern for a Go file. |
| 14 |
go list ./a.go |
| 15 |
stdout '^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 |
| 20 |
stderr '^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 -- |
| 30 |
package main |
| 31 |
-- bar/a.go -- |
| 32 |
package bar |
| 33 |
-- foo.go/a.go -- |
| 34 |
package foo.go |
| 35 |
-- go.mod -- |
| 36 |
module "test" |
| 37 |
|
| 38 |
go 1.13 |