mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
parent
87ed24a113
commit
69e9f41b4c
4 changed files with 6 additions and 8 deletions
|
|
@ -45,7 +45,6 @@ import (
|
|||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
|
@ -377,7 +376,7 @@ func downloadProtocGenGo(cachedir string) string {
|
|||
|
||||
url := fmt.Sprintf("https://github.com/protocolbuffers/protobuf-go/releases/download/v%s/%s", version, archiveName)
|
||||
|
||||
archivePath := path.Join(cachedir, archiveName)
|
||||
archivePath := filepath.Join(cachedir, archiveName)
|
||||
if err := csdb.DownloadFile(url, archivePath); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@ import (
|
|||
"log"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strconv"
|
||||
|
|
@ -116,7 +115,7 @@ func RunGit(args ...string) string {
|
|||
|
||||
// readGitFile returns content of file in .git directory.
|
||||
func readGitFile(file string) string {
|
||||
content, err := os.ReadFile(path.Join(".git", file))
|
||||
content, err := os.ReadFile(filepath.Join(".git", file))
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ package jsre
|
|||
|
||||
import (
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
|
|
@ -42,7 +42,7 @@ func (no *testNativeObjectBinding) TestMethod(call goja.FunctionCall) goja.Value
|
|||
func newWithTestJS(t *testing.T, testjs string) *JSRE {
|
||||
dir := t.TempDir()
|
||||
if testjs != "" {
|
||||
if err := os.WriteFile(path.Join(dir, "test.js"), []byte(testjs), os.ModePerm); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(dir, "test.js"), []byte(testjs), os.ModePerm); err != nil {
|
||||
t.Fatal("cannot create test.js:", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ func TestAuthEndpoints(t *testing.T) {
|
|||
t.Fatalf("failed to create jwt secret: %v", err)
|
||||
}
|
||||
// Geth must read it from a file, and does not support in-memory JWT secrets, so we create a temporary file.
|
||||
jwtPath := path.Join(t.TempDir(), "jwt_secret")
|
||||
jwtPath := filepath.Join(t.TempDir(), "jwt_secret")
|
||||
if err := os.WriteFile(jwtPath, []byte(hexutil.Encode(secret[:])), 0600); err != nil {
|
||||
t.Fatalf("failed to prepare jwt secret file: %v", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue