diff options
author | Cameron Moore <[email protected]> | 2017-09-25 21:25:33 -0500 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2017-09-29 16:23:16 +0200 |
commit | 47fdfd5196cd24a23b30afe1d88969ffb413ab59 (patch) | |
tree | e2b4dc5bb5341ab2d8588879fb733ee888b9164b /tpl/collections | |
parent | d45e358a0543d987091ef54b56eadd9cebda2e0f (diff) | |
download | hugo-47fdfd5196cd24a23b30afe1d88969ffb413ab59.tar.gz hugo-47fdfd5196cd24a23b30afe1d88969ffb413ab59.zip |
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/collections')
-rw-r--r-- | tpl/collections/collections.go | 10 |
1 files changed, 5 insertions, 5 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) } } |