Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultFuncs = template.FuncMap{ "toUpper": strings.ToUpper, "toLower": strings.ToLower, "title": strings.Title, "join": func(sep string, s []string) string { return strings.Join(s, sep) }, "match": regexp.MatchString, "safeHtml": func(text string) html.HTML { return html.HTML(text) }, "reReplaceAll": func(pattern, repl, text string) string { re := regexp.MustCompile(pattern) return re.ReplaceAllString(text, repl) }, "stringSlice": func(s ...string) []string { return s }, "since": func(t time.Time) string { return durafmt.Parse(time.Since(t)).String() }, "duration": func(start time.Time, end time.Time) string { return durafmt.Parse(end.Sub(start)).String() }, }
Functions ¶
This section is empty.
Types ¶
type Template ¶
type Template struct {
// contains filtered or unexported fields
}
func NewTemplate ¶
func ParseFiles ¶
Click to show internal directories.
Click to hide internal directories.