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

@@ -21,6 +21,7 @@ import (
"context"
"errors"
"math/rand"
"slices"
"sort"
"strconv"
"sync"
@@ -60,7 +61,7 @@ func init() {
)
}
func log(format string, data ...interface{}) {
func log(format string, data ...any) {
if dsyncLog {
console.Printf(format, data...)
}
@@ -621,13 +622,7 @@ func (dm *DRWMutex) Unlock(ctx context.Context) {
defer dm.m.Unlock()
// Check if minimally a single bool is set in the writeLocks array
lockFound := false
for _, uid := range dm.writeLocks {
if isLocked(uid) {
lockFound = true
break
}
}
lockFound := slices.ContainsFunc(dm.writeLocks, isLocked)
if !lockFound {
panic("Trying to Unlock() while no Lock() is active")
}
@@ -672,13 +667,7 @@ func (dm *DRWMutex) RUnlock(ctx context.Context) {
defer dm.m.Unlock()
// Check if minimally a single bool is set in the writeLocks array
lockFound := false
for _, uid := range dm.readLocks {
if isLocked(uid) {
lockFound = true
break
}
}
lockFound := slices.ContainsFunc(dm.readLocks, isLocked)
if !lockFound {
panic("Trying to RUnlock() while no RLock() is active")
}