dati

A Go library/binary to parse & execute data against template langauges.
git clone git://src.gearsix.net/dati
Log | Files | Refs | Atom | README | LICENSE

commit 558cb2cc2e31e860daae15f1d5b82803d1630e3e
parent cd53c14313b6e89c5cbfb80c67434fbadfaf1651
Author: gearsix <gearsix@tuta.io>
Date:   Thu, 30 Sep 2021 00:22:51 +0100

loadTemplateFile* -> LoadTemplateFile*

Diffstat:
Mtemplate.go | 15+++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/template.go b/template.go @@ -85,7 +85,8 @@ func (t *Template) Execute(d interface{}) (result bytes.Buffer, err error) { return } -func loadTemplateFileTmpl(root string, partials ...string) (*tmpl.Template, error) { +// TODO +func LoadTemplateFileTmpl(root string, partials ...string) (*tmpl.Template, error) { var stat os.FileInfo t, e := tmpl.ParseFiles(root) @@ -118,7 +119,8 @@ func loadTemplateFileTmpl(root string, partials ...string) (*tmpl.Template, erro return t, e } -func loadTemplateFileHmpl(root string, partials ...string) (*hmpl.Template, error) { +// TODO +func LoadTemplateFileHmpl(root string, partials ...string) (*hmpl.Template, error) { var stat os.FileInfo t, e := hmpl.ParseFiles(root) @@ -151,7 +153,8 @@ func loadTemplateFileHmpl(root string, partials ...string) (*hmpl.Template, erro return t, e } -func loadTemplateFileMst(root string, partials ...string) (*mst.Template, error) { +// TODO +func LoadTemplateFileMst(root string, partials ...string) (*mst.Template, error) { var err error for p, partial := range partials { if err != nil { @@ -203,11 +206,11 @@ func LoadTemplateFile(root string, partials ...string) (t Template, e error) { t = Template{Source: root} ttype := getTemplateType(root) if ttype == "tmpl" || ttype == "gotmpl" { - t.Template, e = loadTemplateFileTmpl(root, partials...) + t.Template, e = LoadTemplateFileTmpl(root, partials...) } else if ttype == "hmpl" || ttype == "gohmpl" { - t.Template, e = loadTemplateFileHmpl(root, partials...) + t.Template, e = LoadTemplateFileHmpl(root, partials...) } else if ttype == "mst" || ttype == "mustache" { - t.Template, e = loadTemplateFileMst(root, partials...) + t.Template, e = LoadTemplateFileMst(root, partials...) } else { e = fmt.Errorf("'%s' is not a supported template language", ttype) }