mirror of
https://github.com/unpoller/unpoller.git
synced 2026-03-31 06:24:19 -04:00
update golangci-lint, address lint issue
This commit is contained in:
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -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
1
.gitignore
vendored
@@ -39,3 +39,4 @@ github_deploy_key*
|
||||
/gpg.signing.key
|
||||
dist/
|
||||
.vscode/
|
||||
.idea/
|
||||
|
||||
@@ -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:]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user