all: Run modernize -fix ./...

This commit is contained in:
Bjørn Erik Pedersen
2025-02-26 10:15:04 +01:00
parent b7ae24b9c2
commit 521911a576
141 changed files with 302 additions and 354 deletions

View File

@@ -93,7 +93,7 @@ func (m *FileMeta) Merge(from *FileMeta) {
dstv := reflect.Indirect(reflect.ValueOf(m))
srcv := reflect.Indirect(reflect.ValueOf(from))
for i := 0; i < dstv.NumField(); i++ {
for i := range dstv.NumField() {
v := dstv.Field(i)
if !v.CanSet() {
continue

View File

@@ -214,7 +214,7 @@ func WalkFilesystems(fs afero.Fs, fn WalkFn) bool {
}
}
} else if cfs, ok := fs.(overlayfs.FilesystemIterator); ok {
for i := 0; i < cfs.NumFilesystems(); i++ {
for i := range cfs.NumFilesystems() {
if WalkFilesystems(cfs.Filesystem(i), fn) {
return true
}

View File

@@ -166,7 +166,7 @@ func FilterGlobParts(a []string) []string {
// HasGlobChar returns whether s contains any glob wildcards.
func HasGlobChar(s string) bool {
for i := 0; i < len(s); i++ {
for i := range len(s) {
if syntax.Special(s[i]) {
return true
}

View File

@@ -91,7 +91,7 @@ func TestWalkRootMappingFs(t *testing.T) {
p := para.New(4)
r, _ := p.Start(context.Background())
for i := 0; i < 8; i++ {
for range 8 {
r.Run(func() error {
_, err := collectPaths(bfs, "")
if err != nil {
@@ -153,7 +153,7 @@ func BenchmarkWalk(b *testing.B) {
fs := NewBaseFileDecorator(afero.NewMemMapFs())
writeFiles := func(dir string, numfiles int) {
for i := 0; i < numfiles; i++ {
for i := range numfiles {
filename := filepath.Join(dir, fmt.Sprintf("file%d.txt", i))
c.Assert(afero.WriteFile(fs, filename, []byte("content"), 0o777), qt.IsNil)
}