diff --git a/accounts/abi/bind/bind.go b/accounts/abi/bind/bind.go index cd68db93c2..6d27ead41e 100644 --- a/accounts/abi/bind/bind.go +++ b/accounts/abi/bind/bind.go @@ -260,7 +260,7 @@ func Bind(types []string, abis []string, bytecodes []string, fsigs []map[string] } // Parse library references. for pattern, name := range libs { - matched, err := regexp.Match("__\\$"+pattern+"\\$__", []byte(contracts[types[i]].InputBin)) + matched, err := regexp.MatchString("__\\$"+pattern+"\\$__", contracts[types[i]].InputBin) if err != nil { log.Error("Could not search for pattern", "pattern", pattern, "contract", contracts[types[i]], "err", err) } diff --git a/core/state/trie_prefetcher.go b/core/state/trie_prefetcher.go index 0228d293b3..9140e4a0e3 100644 --- a/core/state/trie_prefetcher.go +++ b/core/state/trie_prefetcher.go @@ -274,7 +274,6 @@ func (sf *subfetcher) schedule(keys [][]byte, read bool) error { // Append the tasks to the current queue sf.lock.Lock() for _, key := range keys { - key := key // closure for the append below sf.tasks = append(sf.tasks, &subfetcherTask{read: read, key: key}) } sf.lock.Unlock() diff --git a/ctxc/downloader/downloader.go b/ctxc/downloader/downloader.go index 8ba4645af9..7bf685970c 100644 --- a/ctxc/downloader/downloader.go +++ b/ctxc/downloader/downloader.go @@ -519,7 +519,6 @@ func (d *Downloader) spawnSync(fetchers []func() error) error { errc := make(chan error, len(fetchers)) d.cancelWg.Add(len(fetchers)) for _, fn := range fetchers { - fn := fn go func() { defer d.cancelWg.Done(); errc <- fn() }() } // Wait for the first error, then terminate the others. diff --git a/ctxc/filters/api.go b/ctxc/filters/api.go index efa2e51dfa..7ce9b08662 100644 --- a/ctxc/filters/api.go +++ b/ctxc/filters/api.go @@ -265,7 +265,6 @@ func (api *FilterAPI) Logs(ctx context.Context, crit FilterCriteria) (*rpc.Subsc select { case logs := <-matchedLogs: for _, log := range logs { - log := log notifier.Notify(rpcSub.ID, &log) } case <-rpcSub.Err(): // client send an unsubscribe request diff --git a/ctxc/tracers/logger/logger.go b/ctxc/tracers/logger/logger.go index f24312ab37..2a4012f9f5 100644 --- a/ctxc/tracers/logger/logger.go +++ b/ctxc/tracers/logger/logger.go @@ -445,7 +445,7 @@ func formatLogs(logs []StructLog) []StructLogRes { } formatted[index].Stack = &stack } - if trace.ReturnData != nil && len(trace.ReturnData) > 0 { + if len(trace.ReturnData) > 0 { formatted[index].ReturnData = hexutil.Bytes(trace.ReturnData).String() } if trace.Memory != nil { diff --git a/p2p/peer.go b/p2p/peer.go index 924d010d33..579b802840 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -412,7 +412,6 @@ outer: func (p *Peer) startProtocols(writeStart <-chan struct{}, writeErr chan<- error) { p.wg.Add(len(p.running)) for _, proto := range p.running { - proto := proto proto.closed = p.closed proto.wstart = writeStart proto.werr = writeErr