]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/link/internal/ld: rm os.Getwd from elf_test
authorKir Kolyshkin <kolyshkin@gmail.com>
Wed, 4 Sep 2024 03:00:56 +0000 (20:00 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 4 Sep 2024 20:44:48 +0000 (20:44 +0000)
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>
src/cmd/link/internal/ld/elf_test.go

index c2a088598546d130863f80d8bde7234d91dc2914..c42a1173b6e70dec9f50ae7a49dbe9f56899fe04 100644 (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))