Skip to content

Commit 02a59e8

Browse files
committed
all: replace strings.Replace with string.ReplaceAll (ethereum#24835)
1 parent fee2577 commit 02a59e8

File tree

6 files changed

+17
-17
lines changed

6 files changed

+17
-17
lines changed

accounts/abi/bind/bind.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func Bind(types []string, abis []string, bytecodes []string, pkg string, lang La
117117
}
118118
contracts[types[i]] = &tmplContract{
119119
Type: capitalise(types[i]),
120-
InputABI: strings.Replace(strippedABI, "\"", "\\\"", -1),
120+
InputABI: strings.ReplaceAll(strippedABI, "\"", "\\\""),
121121
InputBin: strings.TrimSpace(bytecodes[i]),
122122
Constructor: evmABI.Constructor,
123123
Calls: calls,

cmd/faucet/website.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eth/tracers/internal/tracers/assets.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ethstats/ethstats.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ func (s *Service) readLoop(conn *connWrapper) {
367367
// If the network packet is a system ping, respond to it directly
368368
var ping string
369369
if err := json.Unmarshal(blob, &ping); err == nil && strings.HasPrefix(ping, "primus::ping::") {
370-
if err := conn.WriteJSON(strings.Replace(ping, "ping", "pong", -1)); err != nil {
370+
if err := conn.WriteJSON(strings.ReplaceAll(ping, "ping", "pong")); err != nil {
371371
log.Warn("Failed to respond to system ping message", "err", err)
372372
return
373373
}

internal/jsre/deps/bindata.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

p2p/nat/natupnp_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func (dev *fakeIGD) ServeHTTP(w http.ResponseWriter, r *http.Request) {
218218
}
219219

220220
func (dev *fakeIGD) replaceListenAddr(resp string) string {
221-
return strings.Replace(resp, "{{listenAddr}}", dev.listener.Addr().String(), -1)
221+
return strings.ReplaceAll(resp, "{{listenAddr}}", dev.listener.Addr().String())
222222
}
223223

224224
func (dev *fakeIGD) listen() (err error) {

0 commit comments

Comments
 (0)