Skip to content

Commit e259b56

Browse files
committed
fix test
1 parent e166048 commit e259b56

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed
Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
env GO111MODULE=off
22

3-
! go build
4-
stderr 'cannot find package "\." in:\n\t.WORK/gopath/src/foo'
3+
# Control case: in GOPATH mode,
4+
# a/a.go can import package "./b" using a relative path.
5+
go build a/a.go
6+
! stderr .
57

6-
-- main.go --
7-
package main
8+
# package "a" itself cannot import "./b": "a" has a non-local
9+
# import path, so its imports must also have non-local import paths.
10+
! go build a
11+
stderr '^a[/\\]a.go:3:8: local import "./b" in non-local package$'
812

9-
import _ "./foo"
13+
# package "c" imports itself, which is not allowed.
14+
! go build c
15+
stderr '^c[/\\]c.go:3:8: .: cannot import current directory$'
1016

11-
func main() {}
17+
18+
-- a/a.go --
19+
package a
20+
21+
import _ "./b"
22+
-- a/b/b.go --
23+
package b
24+
-- c/c.go --
25+
package c
26+
27+
import _ "."

0 commit comments

Comments
 (0)