Skip to content

Commit

Permalink
Merge pull request #754 from gzliudan/use_replace_all
Browse files Browse the repository at this point in the history
all: replace strings.Replace with string.ReplaceAll
  • Loading branch information
gzliudan authored Dec 8, 2024
2 parents fee2577 + 02a59e8 commit b0ec104
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion accounts/abi/bind/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func Bind(types []string, abis []string, bytecodes []string, pkg string, lang La
}
contracts[types[i]] = &tmplContract{
Type: capitalise(types[i]),
InputABI: strings.Replace(strippedABI, "\"", "\\\"", -1),
InputABI: strings.ReplaceAll(strippedABI, "\"", "\\\""),
InputBin: strings.TrimSpace(bytecodes[i]),
Constructor: evmABI.Constructor,
Calls: calls,
Expand Down
10 changes: 5 additions & 5 deletions cmd/faucet/website.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions eth/tracers/internal/tracers/assets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ethstats/ethstats.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ func (s *Service) readLoop(conn *connWrapper) {
// If the network packet is a system ping, respond to it directly
var ping string
if err := json.Unmarshal(blob, &ping); err == nil && strings.HasPrefix(ping, "primus::ping::") {
if err := conn.WriteJSON(strings.Replace(ping, "ping", "pong", -1)); err != nil {
if err := conn.WriteJSON(strings.ReplaceAll(ping, "ping", "pong")); err != nil {
log.Warn("Failed to respond to system ping message", "err", err)
return
}
Expand Down
8 changes: 4 additions & 4 deletions internal/jsre/deps/bindata.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion p2p/nat/natupnp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,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) {
Expand Down

0 comments on commit b0ec104

Please sign in to comment.