From 11c9fda82b6439340a3239e9c4674f2405ecb7a5 Mon Sep 17 00:00:00 2001 From: tr1sm0s1n Date: Mon, 10 Mar 2025 18:13:54 +0530 Subject: [PATCH] ethclient: fix testing for Version in Windows --- ethclient/ethclient_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ethclient/ethclient_test.go b/ethclient/ethclient_test.go index e71ba4a404..9e5e09ed76 100644 --- a/ethclient/ethclient_test.go +++ b/ethclient/ethclient_test.go @@ -26,6 +26,7 @@ import ( "path/filepath" "reflect" "runtime" + "strings" "testing" "time" @@ -332,7 +333,7 @@ func testVersion(t *testing.T, client *rpc.Client) { if err != nil { t.Fatalf("unexpected error: %v", err) } - if v != fmt.Sprintf("%s/%s-%s/%s", filepath.Base(os.Args[0]), runtime.GOOS, runtime.GOARCH, runtime.Version()) { + if v != fmt.Sprintf("%s/%s-%s/%s", strings.TrimSuffix(filepath.Base(os.Args[0]), ".exe"), runtime.GOOS, runtime.GOARCH, runtime.Version()) { t.Fatalf("Version returned wrong value: %s", v) } }