ref: a93cbb0d6cc6e3a78ba34aa372abc5b41ca24b2c
parent: bd98182dbde893a8a809661c70633741bbf63911
author: Christian Muehlhaeuser <muesli@gmail.com>
date: Fri Aug 2 10:37:28 EDT 2019
Simplify code - Use bytes.Equal instead of bytes.Compare - Omit range's value where it's unused
--- a/helpers/content_test.go
+++ b/helpers/content_test.go
@@ -45,7 +45,7 @@
c := newTestContentSpec()
for i, test := range tests {
output := c.TrimShortHTML(test.input)
- if bytes.Compare(test.output, output) != 0 {
+ if !bytes.Equal(test.output, output) {
t.Errorf("Test %d failed. Expected %q got %q", i, test.output, output)
}
}
--- a/tpl/tplimpl/template.go
+++ b/tpl/tplimpl/template.go
@@ -512,7 +512,7 @@
return nil, err
}
- for k, _ := range c.notFound {
+ for k := range c.notFound {
t.transformNotFound[k] = true
}
@@ -580,7 +580,7 @@
return nil, err
}
- for k, _ := range c.notFound {
+ for k := range c.notFound {
t.transformNotFound[k] = true
}
@@ -637,7 +637,7 @@
return templT.Tree
}, t.text.transformNotFound},
} {
- for name, _ := range s.transformNotFound {
+ for name := range s.transformNotFound {
templ := s.lookup(name)
if templ != nil {
_, err := applyTemplateTransformers(templateUndefined, templ, s.lookup)