From 8283c6833506d85897428c49c350b8b63d9ec49b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Anda=20Estensen?= Date: Sun, 21 Aug 2022 16:21:09 +0200 Subject: [PATCH] Replace strings.Replace with strings.ReplaceAll (#5128) --- p2p/nat/natupnp_test.go | 2 +- rlp/decode_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/p2p/nat/natupnp_test.go b/p2p/nat/natupnp_test.go index e468f910e..7788aacac 100644 --- a/p2p/nat/natupnp_test.go +++ b/p2p/nat/natupnp_test.go @@ -220,7 +220,7 @@ func (dev *fakeIGD) ServeHTTP(w http.ResponseWriter, r *http.Request) { } func (dev *fakeIGD) replaceListenAddr(resp string) string { - return strings.Replace(resp, "{{listenAddr}}", dev.listener.Addr().String(), -1) + return strings.ReplaceAll(resp, "{{listenAddr}}", dev.listener.Addr().String()) } func (dev *fakeIGD) listen() (err error) { diff --git a/rlp/decode_test.go b/rlp/decode_test.go index 856751273..84755e367 100644 --- a/rlp/decode_test.go +++ b/rlp/decode_test.go @@ -1133,7 +1133,7 @@ func encodeTestSlice(n uint) []byte { } func unhex(str string) []byte { - b, err := hex.DecodeString(strings.Replace(str, " ", "", -1)) + b, err := hex.DecodeString(strings.ReplaceAll(str, " ", "")) if err != nil { panic(fmt.Sprintf("invalid hex string: %q", str)) }