diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-01-28 22:34:10 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-01-28 23:14:09 +0100 |
commit | a795acbcd8b18aa4af384d5c03f30740361c8fcf (patch) | |
tree | 0dbf7b000681a738b892c5235daf52c63cda88b9 /cache/filecache | |
parent | 982d9513e71b3d48e20cfa38454a0e1215a8d963 (diff) | |
download | hugo-a795acbcd8b18aa4af384d5c03f30740361c8fcf.tar.gz hugo-a795acbcd8b18aa4af384d5c03f30740361c8fcf.zip |
all: Run gofumpt -l -w .
Diffstat (limited to 'cache/filecache')
-rw-r--r-- | cache/filecache/filecache_config.go | 4 | ||||
-rw-r--r-- | cache/filecache/filecache_pruner.go | 2 |
2 files changed, 1 insertions, 5 deletions
diff --git a/cache/filecache/filecache_config.go b/cache/filecache/filecache_config.go index 1d57fe72e..6a2b5f3e3 100644 --- a/cache/filecache/filecache_config.go +++ b/cache/filecache/filecache_config.go @@ -15,6 +15,7 @@ package filecache import ( + "errors" "fmt" "path" "path/filepath" @@ -24,8 +25,6 @@ import ( "github.com/gohugoio/hugo/common/maps" "github.com/gohugoio/hugo/config" - "errors" - "github.com/mitchellh/mapstructure" "github.com/spf13/afero" ) @@ -225,7 +224,6 @@ func DecodeConfig(fs afero.Fs, bcfg config.BaseConfig, m map[string]any) (Config // Resolves :resourceDir => /myproject/resources etc., :cacheDir => ... func resolveDirPlaceholder(fs afero.Fs, bcfg config.BaseConfig, placeholder string) (cacheDir string, isResource bool, err error) { - switch strings.ToLower(placeholder) { case ":resourcedir": return "", true, nil diff --git a/cache/filecache/filecache_pruner.go b/cache/filecache/filecache_pruner.go index 2ad6c0bb7..6f224cef4 100644 --- a/cache/filecache/filecache_pruner.go +++ b/cache/filecache/filecache_pruner.go @@ -60,7 +60,6 @@ func (c *Cache) Prune(force bool) (int, error) { counter := 0 err := afero.Walk(c.Fs, "", func(name string, info os.FileInfo, err error) error { - if info == nil { return nil } @@ -69,7 +68,6 @@ func (c *Cache) Prune(force bool) (int, error) { if info.IsDir() { f, err := c.Fs.Open(name) - if err != nil { // This cache dir may not exist. return nil |