From 5de3b97554121ce0a95763cf2b50a8ced76b051b Mon Sep 17 00:00:00 2001 From: Fazlul Shahriar Date: Sat, 23 Nov 2019 00:31:39 -0500 Subject: [PATCH] cmd/link: fix TestStrictDup in module mode Fixes #35790 Change-Id: Ie9df103c5c21b34a378821dfad60804ce4b0cad4 Reviewed-on: https://go-review.googlesource.com/c/go/+/208517 Reviewed-by: Bryan C. Mills Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot --- src/cmd/link/link_test.go | 5 +++++ 1 file changed, 5 insertions(+) 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