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
+5 -5
View File
@@ -61,14 +61,14 @@ func benchmark(b *testing.B, data []string) {
b.Run("concat naive", func(b *testing.B) {
b.ResetTimer()
b.ReportAllocs()
for i := 0; i < b.N; i++ {
for b.Loop() {
concatNaive(data...)
}
})
b.Run("concat fast", func(b *testing.B) {
b.ResetTimer()
b.ReportAllocs()
for i := 0; i < b.N; i++ {
for b.Loop() {
concat(data...)
}
})
@@ -77,7 +77,7 @@ func benchmark(b *testing.B, data []string) {
func BenchmarkConcatImplementation(b *testing.B) {
data := make([]string, 2)
rng := rand.New(rand.NewSource(0))
for i := 0; i < 2; i++ {
for i := range 2 {
var tmp [16]byte
rng.Read(tmp[:])
data[i] = hex.EncodeToString(tmp[:])
@@ -91,7 +91,7 @@ func BenchmarkPathJoinOld(b *testing.B) {
b.ResetTimer()
b.ReportAllocs()
for i := 0; i < b.N; i++ {
for b.Loop() {
pathJoinOld("volume", "path/path/path")
}
})
@@ -102,7 +102,7 @@ func BenchmarkPathJoin(b *testing.B) {
b.ResetTimer()
b.ReportAllocs()
for i := 0; i < b.N; i++ {
for b.Loop() {
pathJoin("volume", "path/path/path")
}
})