update golangci-lint, address lint issue

This commit is contained in:
Cody Lee
2024-12-31 14:12:35 -06:00
parent 19c2610a26
commit 38ac45fc17
3 changed files with 5 additions and 4 deletions

View File

@@ -48,4 +48,4 @@ jobs:
uses: golangci/golangci-lint-action@v6
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.60
version: v1.62

1
.gitignore vendored
View File

@@ -39,3 +39,4 @@ github_deploy_key*
/gpg.signing.key
dist/
.vscode/
.idea/

View File

@@ -76,7 +76,7 @@ func (e Events) Groups(prefix string) (groups []string) {
}
// add adds a new event and makes sure the slice is not too big.
func (e *EventGroup) add(event *Event, max int) {
func (e *EventGroup) add(event *Event, maxValue int) {
if !e.Latest.Before(event.Ts) {
return // Ignore older events.
}
@@ -84,7 +84,7 @@ func (e *EventGroup) add(event *Event, max int) {
e.Latest = event.Ts
e.Events = append(e.Events, event)
if i := len(e.Events) - max; i > 0 {
if i := len(e.Events) - maxValue; i > 0 {
e.Events = e.Events[i:]
}
}