tpl: Fix strings.HasPrefix args order

This commit is contained in:
Iskander (Alex) Sharipov authored and Bjørn Erik Pedersen committed 2019-02-02 01:26:05 +01:00
1 parent 5383fe458c
commit 7201042946
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -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{}
+1 -1
View File
@@ -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{}