mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
all: Apply staticcheck recommendations
This commit is contained in:
@@ -22,7 +22,7 @@ import (
|
||||
|
||||
"github.com/BurntSushi/toml"
|
||||
|
||||
"gopkg.in/yaml.v2"
|
||||
yaml "gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -62,7 +62,7 @@ func InterfaceToConfig(in interface{}, format metadecoders.Format, w io.Writer)
|
||||
return err
|
||||
|
||||
default:
|
||||
return errors.New("Unsupported Format provided")
|
||||
return errors.New("unsupported Format provided")
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -442,13 +442,6 @@ func lexMainSection(l *pageLexer) stateFunc {
|
||||
|
||||
}
|
||||
|
||||
func (l *pageLexer) posFirstNonWhiteSpace() int {
|
||||
f := func(c rune) bool {
|
||||
return !unicode.IsSpace(c)
|
||||
}
|
||||
return bytes.IndexFunc(l.input[l.pos:], f)
|
||||
}
|
||||
|
||||
func lexDone(l *pageLexer) stateFunc {
|
||||
|
||||
// Done!
|
||||
@@ -477,14 +470,6 @@ func (l *pageLexer) hasPrefix(prefix []byte) bool {
|
||||
return bytes.HasPrefix(l.input[l.pos:], prefix)
|
||||
}
|
||||
|
||||
func (l *pageLexer) hasPrefixByte(prefix byte) bool {
|
||||
b := l.input[l.pos:]
|
||||
if len(b) == 0 {
|
||||
return false
|
||||
}
|
||||
return b[0] == prefix
|
||||
}
|
||||
|
||||
// helper functions
|
||||
|
||||
// returns the min index >= 0
|
||||
|
Reference in New Issue
Block a user