Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/parser
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-03-24 12:11:16 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2019-03-24 18:14:51 +0300
commitb5f39d23b86f9cb83c51da9fe4abb4c19c01c3b7 (patch)
treecf23180dc07698391cf47c2fe525755417729020 /parser
parent3011f36c27ecde309325e6c75ca377f4f87fa97a (diff)
all: Apply staticcheck recommendations
Diffstat (limited to 'parser')
-rw-r--r--parser/frontmatter.go4
-rw-r--r--parser/pageparser/pagelexer.go15
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