Skip to content

Commit 69e9f41

Browse files
authored
all: replace path.Join with filepath.Join ethereum#29479 (XinFinOrg#1179)
1 parent 87ed24a commit 69e9f41

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

build/ci.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ import (
4545
"log"
4646
"os"
4747
"os/exec"
48-
"path"
4948
"path/filepath"
5049
"runtime"
5150
"strings"
@@ -377,7 +376,7 @@ func downloadProtocGenGo(cachedir string) string {
377376

378377
url := fmt.Sprintf("https://github.com/protocolbuffers/protobuf-go/releases/download/v%s/%s", version, archiveName)
379378

380-
archivePath := path.Join(cachedir, archiveName)
379+
archivePath := filepath.Join(cachedir, archiveName)
381380
if err := csdb.DownloadFile(url, archivePath); err != nil {
382381
log.Fatal(err)
383382
}

internal/build/util.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"log"
2424
"os"
2525
"os/exec"
26-
"path"
2726
"path/filepath"
2827
"runtime"
2928
"strconv"
@@ -116,7 +115,7 @@ func RunGit(args ...string) string {
116115

117116
// readGitFile returns content of file in .git directory.
118117
func readGitFile(file string) string {
119-
content, err := os.ReadFile(path.Join(".git", file))
118+
content, err := os.ReadFile(filepath.Join(".git", file))
120119
if err != nil {
121120
return ""
122121
}

internal/jsre/jsre_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ package jsre
1818

1919
import (
2020
"os"
21-
"path"
21+
"path/filepath"
2222
"reflect"
2323
"testing"
2424
"time"
@@ -42,7 +42,7 @@ func (no *testNativeObjectBinding) TestMethod(call goja.FunctionCall) goja.Value
4242
func newWithTestJS(t *testing.T, testjs string) *JSRE {
4343
dir := t.TempDir()
4444
if testjs != "" {
45-
if err := os.WriteFile(path.Join(dir, "test.js"), []byte(testjs), os.ModePerm); err != nil {
45+
if err := os.WriteFile(filepath.Join(dir, "test.js"), []byte(testjs), os.ModePerm); err != nil {
4646
t.Fatal("cannot create test.js:", err)
4747
}
4848
}

node/node_auth_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"fmt"
2323
"net/http"
2424
"os"
25-
"path"
25+
"path/filepath"
2626
"testing"
2727
"time"
2828

@@ -98,7 +98,7 @@ func TestAuthEndpoints(t *testing.T) {
9898
t.Fatalf("failed to create jwt secret: %v", err)
9999
}
100100
// Geth must read it from a file, and does not support in-memory JWT secrets, so we create a temporary file.
101-
jwtPath := path.Join(t.TempDir(), "jwt_secret")
101+
jwtPath := filepath.Join(t.TempDir(), "jwt_secret")
102102
if err := os.WriteFile(jwtPath, []byte(hexutil.Encode(secret[:])), 0600); err != nil {
103103
t.Fatalf("failed to prepare jwt secret file: %v", err)
104104
}

0 commit comments

Comments
 (0)