Skip to content

Commit 5c8069e

Browse files
joshfreeCopilot
andcommitted
fix(transport): rename local max to avoid shadowing builtin
revive's redefines-builtin-id flags the local variable named max in the LRU eviction loop, which shadows the Go 1.21 builtin. Rename it to limit; no behavior change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4959e1f9-f8e6-4e97-a487-f395a0123c79
1 parent e33d656 commit 5c8069e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

pkg/http/transport/etag.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ func (t *ETagTransport) add(key string, entry etagEntry) {
183183
el := t.ll.PushFront(&lruItem{key: key, entry: entry})
184184
t.items[key] = el
185185

186-
max := t.MaxEntries
187-
if max <= 0 {
188-
max = defaultETagCacheSize
186+
limit := t.MaxEntries
187+
if limit <= 0 {
188+
limit = defaultETagCacheSize
189189
}
190-
for t.ll.Len() > max {
190+
for t.ll.Len() > limit {
191191
oldest := t.ll.Back()
192192
if oldest == nil {
193193
break

0 commit comments

Comments
 (0)