Run modernize (#21546)

`go run golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize@latest -fix -test ./...` executed.

`go generate ./...` ran afterwards to keep generated.
This commit is contained in:
Klaus Post
2025-08-29 04:39:48 +02:00
committed by GitHub
parent 3b7cb6512c
commit f0b91e5504
238 changed files with 913 additions and 1257 deletions

View File

@@ -17,6 +17,8 @@
package event
import "maps"
// TargetIDSet - Set representation of TargetIDs.
type TargetIDSet map[TargetID]struct{}
@@ -28,9 +30,7 @@ func (set TargetIDSet) IsEmpty() bool {
// Clone - returns copy of this set.
func (set TargetIDSet) Clone() TargetIDSet {
setCopy := NewTargetIDSet()
for k, v := range set {
setCopy[k] = v
}
maps.Copy(setCopy, set)
return setCopy
}

View File

@@ -19,6 +19,7 @@ package event
import (
"fmt"
"maps"
"net/http"
"strings"
"sync"
@@ -151,9 +152,7 @@ func (list *TargetList) TargetMap() map[TargetID]Target {
defer list.RUnlock()
ntargets := make(map[TargetID]Target, len(list.targets))
for k, v := range list.targets {
ntargets[k] = v
}
maps.Copy(ntargets, list.targets)
return ntargets
}

View File

@@ -35,7 +35,7 @@ const (
logSubsys = "notify"
)
func logOnceIf(ctx context.Context, err error, id string, errKind ...interface{}) {
func logOnceIf(ctx context.Context, err error, id string, errKind ...any) {
logger.LogOnceIf(ctx, logSubsys, err, id, errKind...)
}