Skip to content

Commit

Permalink
multi: enable prealloc linter for non-test code
Browse files Browse the repository at this point in the history
  • Loading branch information
guggero committed May 6, 2021
1 parent 952bdeb commit eb989f6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ linters:
# land.
- gocyclo

# Instances of table driven tests that don't pre-allocate shouldn't trigger
# the linter.
- prealloc

# Init functions are used by loggers throughout the codebase.
- gochecknoinits

Expand All @@ -48,3 +44,7 @@ issues:
- gosec
- errcheck
- dupl

# Instances of table driven tests that don't pre-allocate shouldn't
# trigger the linter.
- prealloc
8 changes: 4 additions & 4 deletions blockmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,12 +822,12 @@ type checkpointedCFHeadersQuery struct {

// requests creates the query.Requests for this CF headers query.
func (c *checkpointedCFHeadersQuery) requests() []*query.Request {
var reqs []*query.Request
for _, m := range c.msgs {
reqs = append(reqs, &query.Request{
reqs := make([]*query.Request, len(c.msgs))
for idx, m := range c.msgs {
reqs[idx] = &query.Request{
Req: m,
HandleResp: c.handleResponse,
})
}
}
return reqs
}
Expand Down
2 changes: 1 addition & 1 deletion neutrino.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func (sp *ServerPeer) OnAddr(_ *peer.Peer, msg *wire.MsgAddr) {
return
}

var addrsSupportingServices []*wire.NetAddress
addrsSupportingServices := make([]*wire.NetAddress, 0, len(msg.AddrList))
for _, na := range msg.AddrList {
// Don't add more address if we're disconnecting.
if !sp.Connected() {
Expand Down

0 comments on commit eb989f6

Please sign in to comment.