diff options
Diffstat (limited to 'content/en/functions/dict.md')
-rw-r--r-- | content/en/functions/dict.md | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/content/en/functions/dict.md b/content/en/functions/dict.md index 007cc30c5..76fdde284 100644 --- a/content/en/functions/dict.md +++ b/content/en/functions/dict.md @@ -21,6 +21,12 @@ aliases: [] `dict` is especially useful for passing more than one value to a partial template. +Note that the `key` can be either a `string` or a `string slice`. The latter is useful to create a deply nested structure, e.g.: + +```go-text-template +{{ $m := dict (slice "a" "b" "c") "value" }} +``` + ## Example: Using `dict` to pass multiple values to a `partial` |