Skip to content

Commit 7201042

Browse files
quasilytebep
authored andcommitted
tpl: Fix strings.HasPrefix args order
1 parent 5383fe4 commit 7201042

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tpl/partials/partials.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ type Namespace struct {
6565
// Include executes the named partial and returns either a string,
6666
// when the partial is a text/template, or template.HTML when html/template.
6767
func (ns *Namespace) Include(name string, contextList ...interface{}) (interface{}, error) {
68-
if strings.HasPrefix("partials/", name) {
68+
if strings.HasPrefix(name, "partials/") {
6969
name = name[8:]
7070
}
7171
var context interface{}

tpl/tplimpl/templateFuncster.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func newTemplateFuncster(deps *deps.Deps) *templateFuncster {
3939
// Partial executes the named partial and returns either a string,
4040
// when called from text/template, for or a template.HTML.
4141
func (t *templateFuncster) partial(name string, contextList ...interface{}) (interface{}, error) {
42-
if strings.HasPrefix("partials/", name) {
42+
if strings.HasPrefix(name, "partials/") {
4343
name = name[8:]
4444
}
4545
var context interface{}

0 commit comments

Comments
 (0)