Simply choose an extremely unlikely path name in the test is fine.
Fixes #21013.
Change-Id: I56c0a1986b5ef5d618c7fe2b14701f584fe81c37
Reviewed-on: https://go-review.googlesource.com/81578
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
const src = `
package p
-import "foo" // should only see an error here
+import foo "go/types/thisdirectorymustnotexistotherwisethistestmayfail/foo" // should only see an error here
const c = foo.C
type T = foo.T
conf := Config{
Error: func(err error) {
// we should only see the import error
- if errcount > 0 || !strings.Contains(err.Error(), "could not import foo") {
+ if errcount > 0 || !strings.Contains(err.Error(), "could not import") {
t.Errorf("for %s importer, got unexpected error: %v", compiler, err)
}
errcount++