mirror of
https://github.com/golang/go
synced 2024-11-25 10:47:56 -07:00
fix test
This commit is contained in:
parent
e166048bdb
commit
e259b563fd
@ -1,11 +1,27 @@
|
||||
env GO111MODULE=off
|
||||
|
||||
! go build
|
||||
stderr 'cannot find package "\." in:\n\t.WORK/gopath/src/foo'
|
||||
# Control case: in GOPATH mode,
|
||||
# a/a.go can import package "./b" using a relative path.
|
||||
go build a/a.go
|
||||
! stderr .
|
||||
|
||||
-- main.go --
|
||||
package main
|
||||
# package "a" itself cannot import "./b": "a" has a non-local
|
||||
# import path, so its imports must also have non-local import paths.
|
||||
! go build a
|
||||
stderr '^a[/\\]a.go:3:8: local import "./b" in non-local package$'
|
||||
|
||||
import _ "./foo"
|
||||
# package "c" imports itself, which is not allowed.
|
||||
! go build c
|
||||
stderr '^c[/\\]c.go:3:8: .: cannot import current directory$'
|
||||
|
||||
func main() {}
|
||||
|
||||
-- a/a.go --
|
||||
package a
|
||||
|
||||
import _ "./b"
|
||||
-- a/b/b.go --
|
||||
package b
|
||||
-- c/c.go --
|
||||
package c
|
||||
|
||||
import _ "."
|
Loading…
Reference in New Issue
Block a user