diff options
author | Cameron Moore <moorereason@gmail.com> | 2017-09-26 05:25:33 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-09-29 17:23:16 +0300 |
commit | 47fdfd5196cd24a23b30afe1d88969ffb413ab59 (patch) | |
tree | e2b4dc5bb5341ab2d8588879fb733ee888b9164b /tpl | |
parent | d45e358a0543d987091ef54b56eadd9cebda2e0f (diff) |
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
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/collections/collections.go | 10 | ||||
-rw-r--r-- | tpl/fmt/fmt.go | 2 | ||||
-rw-r--r-- | tpl/images/images.go | 1 |
3 files changed, 7 insertions, 6 deletions
diff --git a/tpl/collections/collections.go b/tpl/collections/collections.go index 8f09097a7..34b8e7f77 100644 --- a/tpl/collections/collections.go +++ b/tpl/collections/collections.go @@ -503,25 +503,25 @@ func (i *intersector) appendIfNotSeen(v reflect.Value) { } } -func (ins *intersector) handleValuePair(l1vv, l2vv reflect.Value) { +func (i *intersector) handleValuePair(l1vv, l2vv reflect.Value) { switch kind := l1vv.Kind(); { case kind == reflect.String: l2t, err := toString(l2vv) if err == nil && l1vv.String() == l2t { - ins.appendIfNotSeen(l1vv) + i.appendIfNotSeen(l1vv) } case isNumber(kind): f1, err1 := numberToFloat(l1vv) f2, err2 := numberToFloat(l2vv) if err1 == nil && err2 == nil && f1 == f2 { - ins.appendIfNotSeen(l1vv) + i.appendIfNotSeen(l1vv) } case kind == reflect.Ptr, kind == reflect.Struct: if l1vv.Interface() == l2vv.Interface() { - ins.appendIfNotSeen(l1vv) + i.appendIfNotSeen(l1vv) } case kind == reflect.Interface: - ins.handleValuePair(reflect.ValueOf(l1vv.Interface()), l2vv) + i.handleValuePair(reflect.ValueOf(l1vv.Interface()), l2vv) } } diff --git a/tpl/fmt/fmt.go b/tpl/fmt/fmt.go index e9d47dbd4..96695442e 100644 --- a/tpl/fmt/fmt.go +++ b/tpl/fmt/fmt.go @@ -37,7 +37,7 @@ func (ns *Namespace) Printf(format string, a ...interface{}) string { } -// Print returns string representation of the passed arguments ending with a newline. +// Println returns string representation of the passed arguments ending with a newline. func (ns *Namespace) Println(a ...interface{}) string { return _fmt.Sprintln(a...) } diff --git a/tpl/images/images.go b/tpl/images/images.go index ce29ac4d5..66999aa37 100644 --- a/tpl/images/images.go +++ b/tpl/images/images.go @@ -23,6 +23,7 @@ import ( _ "image/jpeg" _ "image/png" + // Import webp codec _ "golang.org/x/image/webp" "github.com/gohugoio/hugo/deps" |