1
0
mirror of https://github.com/golang/go synced 2024-09-23 07:23:18 -06:00

cmd/link/internal/ld: rm os.Getwd from elf_test

When specifying the package to build, a relative path is sufficient.

Change-Id: I1ae08065b5cd77ec25be42dc1e664720a07baa62
Reviewed-on: https://go-review.googlesource.com/c/go/+/610039
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Commit-Queue: Ian Lance Taylor <iant@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
This commit is contained in:
Kir Kolyshkin 2024-09-03 20:00:56 -07:00 committed by Gopher Robot
parent 9ba8ac253e
commit a2891aef75

View File

@ -94,14 +94,8 @@ func TestNoDuplicateNeededEntries(t *testing.T) {
t.Parallel()
dir := t.TempDir()
wd, err := os.Getwd()
if err != nil {
t.Fatalf("Failed to get working directory: %v", err)
}
path := filepath.Join(dir, "x")
argv := []string{"build", "-o", path, filepath.Join(wd, "testdata", "issue39256")}
argv := []string{"build", "-o", path, "./testdata/issue39256"}
out, err := testenv.Command(t, testenv.GoToolPath(t), argv...).CombinedOutput()
if err != nil {
t.Fatalf("Build failure: %s\n%s\n", err, string(out))