mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-26 21:51:02 +03:00
Clean up lint in various packages
Changes fall into one of the following: - gofmt -s - receiver name is inconsistent - omit unused 2nd value from range - godoc comment formed incorrectly - err assigned and not used - if block ends with a return statement followed by else
This commit is contained in:
parent
d45e358a05
commit
47fdfd5196
12 changed files with 44 additions and 42 deletions
|
@ -158,14 +158,14 @@ func (f *Filesystem) avoid(filePath string) bool {
|
|||
return false
|
||||
}
|
||||
|
||||
func (s SourceSpec) isNonProcessablePath(filePath string) bool {
|
||||
func (sp SourceSpec) isNonProcessablePath(filePath string) bool {
|
||||
base := filepath.Base(filePath)
|
||||
if strings.HasPrefix(base, ".") ||
|
||||
strings.HasPrefix(base, "#") ||
|
||||
strings.HasSuffix(base, "~") {
|
||||
return true
|
||||
}
|
||||
ignoreFiles := cast.ToStringSlice(s.Cfg.Get("ignoreFiles"))
|
||||
ignoreFiles := cast.ToStringSlice(sp.Cfg.Get("ignoreFiles"))
|
||||
if len(ignoreFiles) > 0 {
|
||||
for _, ignorePattern := range ignoreFiles {
|
||||
match, err := regexp.MatchString(ignorePattern, filePath)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue