diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -54,6 +54,7 @@ Gomplate is an alternative that will let you process templates which also includ - [`trim`](#trim) - [`urlParse`](#urlparse) - [`has`](#has) + - [`join`](#join) - [`indent`](#indent) - [`json`](#json) - [`jsonArray`](#jsonarray) @@ -489,6 +490,23 @@ $ gomplate -d vault:///secret/foo < input.tmpl The secret is 'foo: bar' ``` +#### `join` + +Concatenates the elements of an array to create a string. The separator string sep is placed between elements in the resulting string. + +##### Example + +_`input.tmpl`_ +``` +{{ $a := `[1, 2, 3]` | jsonArray }} +{{ join $a "-" }} +``` + +```console +$ gomplate -f input.tmpl +1-2-3 +``` + #### `indent` Indents a given string with the given indentation pattern. If the input string has multiple lines, each line will be indented. |
