Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultFuncs = FuncMap{ "toUpper": strings.ToUpper, "toLower": strings.ToLower, "title": func(text string) string { return cases.Title(language.AmericanEnglish).String(text) }, "trimSpace": strings.TrimSpace, "join": func(sep string, s []string) string { return strings.Join(s, sep) }, "match": regexp.MatchString, "reReplaceAll": func(pattern, repl, text string) string { re := regexp.MustCompile(pattern) return re.ReplaceAllString(text, repl) }, "stringSlice": func(s ...string) []string { return s }, "date": func(fmt string, t time.Time) string { return t.Format(fmt) }, "tz": func(name string, t time.Time) (time.Time, error) { loc, err := time.LoadLocation(name) if err != nil { return time.Time{}, err } return t.In(loc), nil }, "since": time.Since, "last": func(index int, slice interface{}) bool { v := reflect.ValueOf(slice) return index == v.Len()-1 }, }
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.