tpl: fix default function

This commit fixes a few things:

1. `given` is now a variadic parameter so that piping works properly
2. add separate template tests to make sure piping works
3. support time values
4. add more tests of the dfault function
This commit is contained in:
Cameron Moore authored and Bjørn Erik Pedersen committed 2016-03-10 17:47:59 +01:00
1 parent 89aa9203f4
commit 6b9abc6cf3
1 file changed
+1 -1
+1 -1
View File
@@ -37,7 +37,7 @@ non-nil for any other types.
e.g.
{{ index .Params "font" | default "Roboto" }} → default is "Roboto"
{{ default "Roboto" .Params.font }} → default is "Roboto"
{{ default "Roboto" (index .Params "font") }} → default is "Roboto"
### delimit
Loops through any array, slice or map and returns a string of all the values separated by the delimiter. There is an optional third parameter that lets you choose a different delimiter to go between the last two values.