diff --git a/src/cmd/link/link_test.go b/src/cmd/link/link_test.go index 92830fe8b3f..1515f975584 100644 --- a/src/cmd/link/link_test.go +++ b/src/cmd/link/link_test.go @@ -420,6 +420,11 @@ func TestStrictDup(t *testing.T) { if err != nil { t.Fatal(err) } + src = filepath.Join(tmpdir, "go.mod") + err = ioutil.WriteFile(src, []byte("module teststrictdup\n"), 0666) + if err != nil { + t.Fatal(err) + } cmd := exec.Command(testenv.GoToolPath(t), "build", "-ldflags=-strictdups=1") cmd.Dir = tmpdir