From: Iskander (Alex) Sharipov Date: Sat, 2 Feb 2019 00:26:05 +0000 (+0300) Subject: tpl: Fix strings.HasPrefix args order X-Git-Tag: v0.55.0~65 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=720104294;p=brevno-suite%2Fhugo tpl: Fix strings.HasPrefix args order --- diff --git a/tpl/partials/partials.go b/tpl/partials/partials.go index 39bb153e..ece16276 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 9490123a..1fa6a283 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{}