diff options
author | Tom Helmer Hansen <tom@adapt.dk> | 2015-01-16 23:18:19 +0300 |
---|---|---|
committer | bep <bjorn.erik.pedersen@gmail.com> | 2015-01-18 16:54:26 +0300 |
commit | 871e811339b660232557dca10a6d181a5320d745 (patch) | |
tree | 239d8af69a38abf2d706f08bc368b2d4de078690 /tpl | |
parent | 32d15d91fc8df7fa9f1f53d22c086c7ea43da9f0 (diff) |
Add trim and replace template functions
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/template.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tpl/template.go b/tpl/template.go index a051eba0b..f392f81f0 100644 --- a/tpl/template.go +++ b/tpl/template.go @@ -1237,6 +1237,8 @@ func init() { "relref": RelRef, "apply": Apply, "chomp": Chomp, + "replace": func(a string, b string, c string) string { return strings.Replace(a, b, c, -1) }, + "trim": func(a string, b string) string { return strings.Trim(a, b) }, } chompRegexp = regexp.MustCompile("[\r\n]+$") |