1 cd subdir
2
3 # 'go get' on empty patterns that are necessarily local to the module
4 # should warn that the patterns are empty, exactly once.
5
6 go get ./...
7 stderr -count=1 'matched no packages'
8
9 go get ./...
10 stderr -count=1 'matched no packages'
11
12 # 'go get' on patterns that could conceivably match nested modules
13 # should report a module resolution error.
14
15 go get example.net/emptysubdir/... # control case
16
17 ! go get example.net/emptysubdir/subdir/...
18 ! stderr 'matched no packages'
19 stderr '^go: example\.net/emptysubdir/subdir/\.\.\.: module example\.net/emptysubdir/subdir: reading http://.*: 404 Not Found\n\tserver response: 404 page not found\n\z'
20
21 # It doesn't make sense to 'go get' a path in the standard library,
22 # since the standard library necessarily can't have unresolved imports.
23 #
24 # TODO(#30241): Maybe that won't always be the case?
25 #
26 # For that case, we emit a "malformed module path" error message,
27 # which isn't ideal either.
28
29 ! go get builtin/... # in GOROOT/src, but contains no packages
30 stderr '^go: builtin/...: malformed module path "builtin": missing dot in first path element$'
31
32 -- go.mod --
33 module example.net/emptysubdir
34
35 go 1.16
36 -- emptysubdir.go --
37 // Package emptysubdir has a subdirectory containing no packages.
38 package emptysubdir
39 -- subdir/README.txt --
40 This module intentionally does not contain any p
41
View as plain text