Skip to content

Commit

Permalink
tpl: Fix strings.HasPrefix args order
Browse files Browse the repository at this point in the history
  • Loading branch information
quasilyte authored and bep committed Feb 2, 2019
1 parent 5383fe4 commit 7201042
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tpl/partials/partials.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down
2 changes: 1 addition & 1 deletion tpl/tplimpl/templateFuncster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}
Expand Down

0 comments on commit 7201042

Please sign in to comment.