aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugofs/fs.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2023-12-18 17:41:15 +0100
committerBjørn Erik Pedersen <[email protected]>2023-12-18 19:51:26 +0100
commit8adba648cc130a97d2c814c65aa8396044c251fd (patch)
tree95415853e28ee83e0342cc55944f3bc16d746f4f /hugofs/fs.go
parent6f13430d4a3b0d8b196f13958fbfb6478be1f3aa (diff)
downloadhugo-8adba648cc130a97d2c814c65aa8396044c251fd.tar.gz
hugo-8adba648cc130a97d2c814c65aa8396044c251fd.zip
all: Remove unused code
Using x/tools/cmd/deadcode
Diffstat (limited to 'hugofs/fs.go')
-rw-r--r--hugofs/fs.go13
1 files changed, 2 insertions, 11 deletions
diff --git a/hugofs/fs.go b/hugofs/fs.go
index 9462afa24..5b8a3adb2 100644
--- a/hugofs/fs.go
+++ b/hugofs/fs.go
@@ -60,14 +60,7 @@ type Fs struct {
WorkingDirWritable afero.Fs
}
-// NewDefault creates a new Fs with the OS file system
-// as source and destination file systems.
-func NewDefault(conf config.BaseConfig) *Fs {
- fs := Os
- return NewFrom(fs, conf)
-}
-
-func NewDefaultOld(cfg config.Provider) *Fs {
+func NewDefault(cfg config.Provider) *Fs {
workingDir, publishDir := getWorkingPublishDir(cfg)
fs := Os
return newFs(fs, fs, workingDir, publishDir)
@@ -99,7 +92,6 @@ func getWorkingPublishDir(cfg config.Provider) (string, string) {
publishDir = cfg.GetString("publishDir")
}
return workingDir, publishDir
-
}
func newFs(source, destination afero.Fs, workingDir, publishDir string) *Fs {
@@ -166,7 +158,7 @@ func MakeReadableAndRemoveAllModulePkgDir(fs afero.Fs, dir string) (int, error)
}
if info.IsDir() {
counter++
- fs.Chmod(path, 0777)
+ fs.Chmod(path, 0o777)
}
return nil
})
@@ -217,7 +209,6 @@ func WalkFilesystems(fs afero.Fs, fn WalkFn) bool {
if WalkFilesystems(afs.UnwrapFilesystem(), fn) {
return true
}
-
} else if bfs, ok := fs.(FilesystemsUnwrapper); ok {
for _, sf := range bfs.UnwrapFilesystems() {
if WalkFilesystems(sf, fn) {