mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-24 21:56:05 +02:00
all: Run modernize -fix ./...
This commit is contained in:
@@ -57,14 +57,14 @@ func TestNewBaseFs(t *testing.T) {
|
||||
filenameTheme := filepath.Join(base, fmt.Sprintf("theme-file-%s.txt", theme))
|
||||
filenameOverlap := filepath.Join(base, "f3.txt")
|
||||
afs.Mkdir(base, 0o755)
|
||||
content := []byte(fmt.Sprintf("content:%s:%s", theme, dir))
|
||||
content := fmt.Appendf(nil, "content:%s:%s", theme, dir)
|
||||
afero.WriteFile(afs, filenameTheme, content, 0o755)
|
||||
afero.WriteFile(afs, filenameOverlap, content, 0o755)
|
||||
}
|
||||
// Write some files to the root of the theme
|
||||
base := filepath.Join(workingDir, "themes", theme)
|
||||
afero.WriteFile(afs, filepath.Join(base, fmt.Sprintf("theme-root-%s.txt", theme)), []byte(fmt.Sprintf("content:%s", theme)), 0o755)
|
||||
afero.WriteFile(afs, filepath.Join(base, "file-theme-root.txt"), []byte(fmt.Sprintf("content:%s", theme)), 0o755)
|
||||
afero.WriteFile(afs, filepath.Join(base, fmt.Sprintf("theme-root-%s.txt", theme)), fmt.Appendf(nil, "content:%s", theme), 0o755)
|
||||
afero.WriteFile(afs, filepath.Join(base, "file-theme-root.txt"), fmt.Appendf(nil, "content:%s", theme), 0o755)
|
||||
}
|
||||
|
||||
afero.WriteFile(afs, filepath.Join(workingDir, "file-root.txt"), []byte("content-project"), 0o755)
|
||||
@@ -683,8 +683,8 @@ func setConfigAndWriteSomeFilesTo(fs afero.Fs, v config.Provider, key, val strin
|
||||
workingDir := v.GetString("workingDir")
|
||||
v.Set(key, val)
|
||||
fs.Mkdir(val, 0o755)
|
||||
for i := 0; i < num; i++ {
|
||||
for i := range num {
|
||||
filename := filepath.Join(workingDir, val, fmt.Sprintf("f%d.txt", i+1))
|
||||
afero.WriteFile(fs, filename, []byte(fmt.Sprintf("content:%s:%d", key, i+1)), 0o755)
|
||||
afero.WriteFile(fs, filename, fmt.Appendf(nil, "content:%s:%d", key, i+1), 0o755)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user