mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 06:00:25 +03:00
all: Apply staticcheck recommendations
This commit is contained in:
parent
3011f36c27
commit
b5f39d23b8
41 changed files with 98 additions and 252 deletions
|
@ -14,8 +14,6 @@
|
|||
package source
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
|
@ -23,8 +21,6 @@ import (
|
|||
|
||||
"github.com/gohugoio/hugo/common/hugio"
|
||||
|
||||
"github.com/spf13/afero"
|
||||
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
|
@ -286,24 +282,3 @@ func (sp *SourceSpec) NewFileInfo(baseDir, filename string, isLeafBundle bool, f
|
|||
return f
|
||||
|
||||
}
|
||||
|
||||
func printFs(fs afero.Fs, path string, w io.Writer) {
|
||||
if fs == nil {
|
||||
return
|
||||
}
|
||||
afero.Walk(fs, path, func(path string, info os.FileInfo, err error) error {
|
||||
|
||||
if info != nil && !info.IsDir() {
|
||||
|
||||
s := path
|
||||
if lang, ok := info.(hugofs.LanguageAnnouncer); ok {
|
||||
s = s + "\t" + lang.Lang()
|
||||
}
|
||||
if fp, ok := info.(hugofs.FilePather); ok {
|
||||
s = s + "\t" + fp.Filename()
|
||||
}
|
||||
fmt.Fprintln(w, " ", s)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue