diff options
author | Iskander (Alex) Sharipov <quasilyte@gmail.com> | 2019-02-02 03:26:05 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-02-02 01:26:05 +0100 |
commit | 7201042946dde78d5ea4fea9cb006fb4dded55c1 (patch) | |
tree | b606ba48a81b61d0ff66ceeba4363ea33df8c9fb | |
parent | 5383fe458c0ce24e1623dd91e795d4fb5772ae9d (diff) |
tpl: Fix strings.HasPrefix args order
-rw-r--r-- | tpl/partials/partials.go | 2 | ||||
-rw-r--r-- | tpl/tplimpl/templateFuncster.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/tpl/partials/partials.go b/tpl/partials/partials.go index 39bb153e0..ece16276d 100644 --- a/tpl/partials/partials.go +++ b/tpl/partials/partials.go @@ -65,7 +65,7 @@ type Namespace struct { // Include executes the named partial and returns either a string, // when the partial is a text/template, or template.HTML when html/template. func (ns *Namespace) Include(name string, contextList ...interface{}) (interface{}, error) { - if strings.HasPrefix("partials/", name) { + if strings.HasPrefix(name, "partials/") { name = name[8:] } var context interface{} diff --git a/tpl/tplimpl/templateFuncster.go b/tpl/tplimpl/templateFuncster.go index 9490123ab..1fa6a2835 100644 --- a/tpl/tplimpl/templateFuncster.go +++ b/tpl/tplimpl/templateFuncster.go @@ -39,7 +39,7 @@ func newTemplateFuncster(deps *deps.Deps) *templateFuncster { // Partial executes the named partial and returns either a string, // when called from text/template, for or a template.HTML. func (t *templateFuncster) partial(name string, contextList ...interface{}) (interface{}, error) { - if strings.HasPrefix("partials/", name) { + if strings.HasPrefix(name, "partials/") { name = name[8:] } var context interface{} |