commit bea2bfcdb37fa686dccc42722b1b5fd2915204f3
parent a58d3b11313a15d3782bc3fba8bd06d695700c20
Author: gearsix <gearsix@tuta.io>
Date: Fri, 3 Feb 2023 16:32:38 +0000
depreciated LoadTemplateFilepath for LoadTemplateFile
Diffstat:
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/template.go b/template.go
@@ -93,10 +93,15 @@ func (t *Template) Execute(d interface{}) (result bytes.Buffer, err error) {
return
}
+// **DEPRECIATED** please use LoadTemplateFile
+func LoadTemplateFilepath(rootPath string, partialPaths ...string) (t Template, e error) {
+ return LoadTemplateFile(rootPath, partialPaths...)
+}
+
// LoadTemplateFilepath loads a Template from file `root`. All files in `partials`
// that have the same template type (identified by file extension) are also
// parsed and associated with the parsed root template.
-func LoadTemplateFilepath(rootPath string, partialPaths ...string) (t Template, e error) {
+func LoadTemplateFile(rootPath string, partialPaths ...string) (t Template, e error) {
var stat os.FileInfo
if stat, e = os.Stat(rootPath); e != nil {
return
diff --git a/template_test.go b/template_test.go
@@ -123,6 +123,10 @@ func validateTemplateFile(t *testing.T, template Template, rootPath string, part
}
func TestLoadTemplateFilepath(t *testing.T) {
+ TestLoadTemplateFile(t)
+}
+
+func TestLoadTemplateFile(t *testing.T) {
t.Parallel()
tdir := os.TempDir()