Add hasPrefix template function.
authorColin Bate <colin@colinbate.com>
Thu, 2 Jul 2015 18:31:16 +0000 (15:31 -0300)
committerSteve Francia <steve.francia@gmail.com>
Sat, 2 Jan 2016 15:47:17 +0000 (10:47 -0500)
tpl/template_funcs.go

index 87dde3292c0e66d1a2c4ea3d141578b72c3e62a1..8368bac8412cc096e251eb77f308402068f8029b 100644 (file)
@@ -1428,6 +1428,7 @@ func init() {
                "lower":        func(a string) string { return strings.ToLower(a) },
                "upper":        func(a string) string { return strings.ToUpper(a) },
                "title":        func(a string) string { return strings.Title(a) },
+               "hasPrefix":    func(a, b string) bool { return strings.HasPrefix(a, b) },
                "partial":      Partial,
                "ref":          Ref,
                "relref":       RelRef,