Skip to content

Commit

Permalink
binding: fix linter for prealloc in the GetAllBindings
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
  • Loading branch information
hawkingrei committed Dec 21, 2023
1 parent 11aefee commit f6ff1f4
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/bindinfo/bind_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ func (c *bindCache) GetAllBindings() []*BindRecord {
c.lock.Lock()
defer c.lock.Unlock()
values := c.cache.Values()
//nolint: prealloc
var bindRecords []*BindRecord
bindRecords := make([]*BindRecord, 0, len(values))
for _, vals := range values {
bindRecords = append(bindRecords, vals.([]*BindRecord)...)
}
Expand Down

0 comments on commit f6ff1f4

Please sign in to comment.