Skip to content

Commit 521911a

Browse files
committedFeb 26, 2025·
all: Run modernize -fix ./...
1 parent b7ae24b commit 521911a

File tree

141 files changed

+302
-354
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+302
-354
lines changed
 

‎cache/dynacache/dynacache_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -191,16 +191,16 @@ func TestPanicInCreate(t *testing.T) {
191191
return err
192192
}
193193

194-
for i := 0; i < 3; i++ {
195-
for j := 0; j < 3; j++ {
194+
for i := range 3 {
195+
for range 3 {
196196
c.Assert(willPanic(i), qt.PanicMatches, fmt.Sprintf("panic-%d", i))
197197
c.Assert(willErr(i), qt.ErrorMatches, fmt.Sprintf("error-%d", i))
198198
}
199199
}
200200

201201
// Test the same keys again without the panic.
202-
for i := 0; i < 3; i++ {
203-
for j := 0; j < 3; j++ {
202+
for i := range 3 {
203+
for range 3 {
204204
v, err := p1.GetOrCreate(fmt.Sprintf("panic-%d", i), func(key string) (testItem, error) {
205205
return testItem{
206206
name: key,

‎cache/filecache/filecache_pruner_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ dir = ":resourceDir/_gen"
5959
caches, err := filecache.NewCaches(p)
6060
c.Assert(err, qt.IsNil)
6161
cache := caches[name]
62-
for i := 0; i < 10; i++ {
62+
for i := range 10 {
6363
id := fmt.Sprintf("i%d", i)
6464
cache.GetOrCreateBytes(id, func() ([]byte, error) {
6565
return []byte("abc"), nil
@@ -74,7 +74,7 @@ dir = ":resourceDir/_gen"
7474
c.Assert(err, qt.IsNil)
7575
c.Assert(count, qt.Equals, 5, msg)
7676

77-
for i := 0; i < 10; i++ {
77+
for i := range 10 {
7878
id := fmt.Sprintf("i%d", i)
7979
v := cache.GetString(id)
8080
if i < 5 {
@@ -97,7 +97,7 @@ dir = ":resourceDir/_gen"
9797
c.Assert(count, qt.Equals, 4)
9898

9999
// Now only the i5 should be left.
100-
for i := 0; i < 10; i++ {
100+
for i := range 10 {
101101
id := fmt.Sprintf("i%d", i)
102102
v := cache.GetString(id)
103103
if i != 5 {

0 commit comments

Comments
 (0)