diff options
Diffstat (limited to 'misc/cgo/errors/ptr_test.go')
| -rw-r--r-- | misc/cgo/errors/ptr_test.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/misc/cgo/errors/ptr_test.go b/misc/cgo/errors/ptr_test.go index 254671f179..629f4c9226 100644 --- a/misc/cgo/errors/ptr_test.go +++ b/misc/cgo/errors/ptr_test.go @@ -444,8 +444,8 @@ func testOne(t *testing.T, pt ptrTest) { } defer os.RemoveAll(gopath) - src := filepath.Join(gopath, "src") - if err := os.Mkdir(src, 0777); err != nil { + src := filepath.Join(gopath, "src", "ptrtest") + if err := os.MkdirAll(src, 0777); err != nil { t.Fatal(err) } @@ -490,6 +490,11 @@ func testOne(t *testing.T, pt ptrTest) { } } + gomod := fmt.Sprintf("module %s\n", filepath.Base(src)) + if err := ioutil.WriteFile(filepath.Join(src, "go.mod"), []byte(gomod), 0666); err != nil { + t.Fatalf("writing go.mod: %v", err) + } + args := func(cmd *exec.Cmd) string { return strings.Join(cmd.Args, " ") } |
