all: Apply staticcheck recommendations

This commit is contained in:
Bjørn Erik Pedersen 2019-03-24 10:11:16 +01:00
parent 3011f36c27
commit b5f39d23b8
41 changed files with 98 additions and 252 deletions

View file

@ -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
})
}