Categorygithub.com/gpmd/gotemplate
modulepackage
0.5.3
Repository: https://github.com/gpmd/gotemplate.git
Documentation: pkg.go.dev

# README

Generic Go Template funcs

Usage:

import ( 
    "github.com/gpmd/gotemplate"
)

func main() {
    gotemplate.Template("{{(xml_decode .).mycode}}", "<?xml version=\"1.0\"?><mycode>MYCODE</mycode>")
}

# Functions

GetFuncs will return all usable template funcs as string slice.
MustProcessTemplateFile processes golang template file otherwise panics.
MustTemplate parses string as Go template, using data as scope.
NewParser defines a new parser.
ProcessTemplateFile processes golang template file.
RegisterFS (afero) virtual filesystem for ProcessTemplateFile.
RegisterFunc registers a new template func to the template parser.
Template parses string as Go template, using data as scope.
TemplateDelim parses string with custom delimiters as Go template, using data as scope.

# Structs

Parser is the main type.

# Type aliases

ParserFunc is to parse a []byte into an interface{}.