var _ = x.X
`)
tg.runFail("build", "dir/x")
- tg.grepStderr("local import.*in non-local package", "did not diagnose local import")
+ tg.grepStderr("cannot import current directory", "did not diagnose import current directory")
// ... even in a test.
tg.tempFile("src/dir/x/xx.go", `package x
`)
tg.run("build", "dir/x")
tg.runFail("test", "dir/x")
- tg.grepStderr("local import.*in non-local package", "did not diagnose local import")
+ tg.grepStderr("cannot import current directory", "did not diagnose import current directory")
// ... even in an xtest.
tg.tempFile("src/dir/x/xx.go", `package x
`)
tg.run("build", "dir/x")
tg.runFail("test", "dir/x")
- tg.grepStderr("local import.*in non-local package", "did not diagnose local import")
+ tg.grepStderr("cannot import current directory", "did not diagnose import current directory")
}
func TestGoGetInsecure(t *testing.T) {
if p.Internal.Local && parent != nil && !parent.Internal.Local {
perr := *p
+ errMsg := fmt.Sprintf("local import %q in non-local package", path)
+ if path == "." {
+ errMsg = "cannot import current directory"
+ }
perr.Error = &PackageError{
ImportStack: stk.Copy(),
- Err: fmt.Sprintf("local import %q in non-local package", path),
+ Err: errMsg,
}
return setErrorPos(&perr, importPos)
}