From 080731108c008e189b4384f764f0b6c158d69026 Mon Sep 17 00:00:00 2001 From: Thanatat Tamtan Date: Sat, 23 Sep 2023 16:45:38 +0700 Subject: [PATCH] cleanup --- template.go | 12 ------------ template_test.go | 6 ------ 2 files changed, 18 deletions(-) diff --git a/template.go b/template.go index 6f242cb..79f08e5 100644 --- a/template.go +++ b/template.go @@ -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 diff --git a/template_test.go b/template_test.go index 22eaffd..1f11fc5 100644 --- a/template_test.go +++ b/template_test.go @@ -366,12 +366,6 @@ list: assert.Equal(t, b.String(), `go`) }) - 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{}))