From 38ac45fc1782d8ff1850cdc64fea39885571ef07 Mon Sep 17 00:00:00 2001 From: Cody Lee Date: Tue, 31 Dec 2024 14:12:35 -0600 Subject: [PATCH] update golangci-lint, address lint issue --- .github/workflows/build.yml | 2 +- .gitignore | 3 ++- pkg/webserver/plugins_types.go | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6b8735d1..139c7507 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.gitignore b/.gitignore index b3d6864e..3f5a00f4 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,5 @@ github_deploy_key* /before-remove-rendered.sh /gpg.signing.key dist/ -.vscode/ \ No newline at end of file +.vscode/ +.idea/ diff --git a/pkg/webserver/plugins_types.go b/pkg/webserver/plugins_types.go index 47891397..e87bed18 100644 --- a/pkg/webserver/plugins_types.go +++ b/pkg/webserver/plugins_types.go @@ -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:] } }