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

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