mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
all: Run modernize -fix ./...
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user