diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-03-24 10:11:16 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-03-24 16:14:51 +0100 |
commit | b5f39d23b86f9cb83c51da9fe4abb4c19c01c3b7 (patch) | |
tree | cf23180dc07698391cf47c2fe525755417729020 /parser | |
parent | 3011f36c27ecde309325e6c75ca377f4f87fa97a (diff) |
all: Apply staticcheck recommendations
Diffstat (limited to 'parser')
-rw-r--r-- | parser/frontmatter.go | 4 | ||||
-rw-r--r-- | parser/pageparser/pagelexer.go | 15 |
2 files changed, 2 insertions, 17 deletions
diff --git a/parser/frontmatter.go b/parser/frontmatter.go index ab1bc4d55..4965d3fe8 100644 --- a/parser/frontmatter.go +++ b/parser/frontmatter.go @@ -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") } } diff --git a/parser/pageparser/pagelexer.go b/parser/pageparser/pagelexer.go index 11723f279..d010c8152 100644 --- a/parser/pageparser/pagelexer.go +++ b/parser/pageparser/pagelexer.go @@ -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 |