mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
parent
87ed24a113
commit
69e9f41b4c
4 changed files with 6 additions and 8 deletions
|
|
@ -45,7 +45,6 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"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)
|
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 {
|
if err := csdb.DownloadFile(url, archivePath); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,6 @@ import (
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
"path"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
|
@ -116,7 +115,7 @@ func RunGit(args ...string) string {
|
||||||
|
|
||||||
// readGitFile returns content of file in .git directory.
|
// readGitFile returns content of file in .git directory.
|
||||||
func readGitFile(file string) string {
|
func readGitFile(file string) string {
|
||||||
content, err := os.ReadFile(path.Join(".git", file))
|
content, err := os.ReadFile(filepath.Join(".git", file))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ package jsre
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path/filepath"
|
||||||
"reflect"
|
"reflect"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
@ -42,7 +42,7 @@ func (no *testNativeObjectBinding) TestMethod(call goja.FunctionCall) goja.Value
|
||||||
func newWithTestJS(t *testing.T, testjs string) *JSRE {
|
func newWithTestJS(t *testing.T, testjs string) *JSRE {
|
||||||
dir := t.TempDir()
|
dir := t.TempDir()
|
||||||
if testjs != "" {
|
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)
|
t.Fatal("cannot create test.js:", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -98,7 +98,7 @@ func TestAuthEndpoints(t *testing.T) {
|
||||||
t.Fatalf("failed to create jwt secret: %v", err)
|
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.
|
// 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 {
|
if err := os.WriteFile(jwtPath, []byte(hexutil.Encode(secret[:])), 0600); err != nil {
|
||||||
t.Fatalf("failed to prepare jwt secret file: %v", err)
|
t.Fatalf("failed to prepare jwt secret file: %v", err)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue