Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
acoshift committed Sep 23, 2023
1 parent ecfef1f commit 0807311
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
12 changes: 0 additions & 12 deletions template.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,18 +361,6 @@ func joinTemplateDir(dir string, filenames ...string) []string {
return xs
}

func cloneFuncMaps(xs []template.FuncMap) []template.FuncMap {
if xs == nil {
return nil
}

rs := make([]template.FuncMap, len(xs))
for i := range xs {
rs[i] = xs[i]
}
return rs
}

func cloneTmpl(xs map[string]*tmpl) map[string]*tmpl {
if xs == nil {
return nil
Expand Down
6 changes: 0 additions & 6 deletions template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,6 @@ list:
assert.Equal(t, b.String(), `<a href="/p?id=1">go</a>`)
})

t.Run("cloneFuncMaps", func(t *testing.T) {
assert.Nil(t, cloneFuncMaps(nil))
assert.NotNil(t, cloneFuncMaps([]template.FuncMap{}))
assert.Len(t, cloneFuncMaps([]template.FuncMap{{"a": func() string { return "" }}}), 1)
})

t.Run("cloneTmpl", func(t *testing.T) {
assert.Nil(t, cloneTmpl(nil))
assert.NotNil(t, cloneTmpl(map[string]*tmpl{}))
Expand Down

0 comments on commit 0807311

Please sign in to comment.