From f3f9763afd7955780b803de511a2a1eca7c8c8ae Mon Sep 17 00:00:00 2001 From: Cameron Moore Date: Wed, 9 Mar 2016 16:46:16 -0600 Subject: [PATCH] tpl: Add time note to default func description --- docs/content/templates/functions.md | 6 +++--- tpl/template_funcs.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/content/templates/functions.md b/docs/content/templates/functions.md index 912bb3cde..599e61bda 100644 --- a/docs/content/templates/functions.md +++ b/docs/content/templates/functions.md @@ -30,9 +30,9 @@ and other basic tools; these are listed in the ### default Checks whether a given value is set and returns a default value if it is not. -"Set" in this context means true for booleans; non-zero for numeric types; -non-zero length for strings, arrays, slices, and maps; any struct value; or -non-nil for any other types. +"Set" in this context means true for booleans; non-zero for numeric types and +times; non-zero length for strings, arrays, slices, and maps; any struct value; +or non-nil for any other types. e.g. diff --git a/tpl/template_funcs.go b/tpl/template_funcs.go index 4df811a1c..3e87ab058 100644 --- a/tpl/template_funcs.go +++ b/tpl/template_funcs.go @@ -1241,8 +1241,8 @@ func dateFormat(layout string, v interface{}) (string, error) { // dfault checks whether a given value is set and returns a default value if it // is not. "Set" in this context means true for booleans; non-zero for numeric -// types; non-zero length for strings, arrays, slices, and maps; any struct -// value; or non-nil for any other types. +// types and times; non-zero length for strings, arrays, slices, and maps; any +// struct value; or non-nil for any other types. func dfault(dflt interface{}, given ...interface{}) (interface{}, error) { // given is variadic because the following construct will not pass a piped // argument when the key is missing: {{ index . "key" | default "foo" }}