From 7d646a828a363db3d11ece2c2c2c9c560494e95c Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Sat, 1 Jun 2024 17:26:53 -0400 Subject: feat(strings): Update strings.Indent to error on bad input instead of silently doing nothing (#2089) Signed-off-by: Dave Henderson --- docs/content/functions/strings.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/content/functions/strings.md b/docs/content/functions/strings.md index ead0dc27..5e43ac1e 100644 --- a/docs/content/functions/strings.md +++ b/docs/content/functions/strings.md @@ -143,6 +143,8 @@ http://example.com:80 Indents a string. If the input string has multiple lines, each line will be indented. +As of v4.0.0, this function will error if the `width` or `indent` arguments are invalid. + _Added in gomplate [v1.9.0](https://github.com/hairyhenderson/gomplate/releases/tag/v1.9.0)_ ### Usage @@ -157,9 +159,9 @@ input | strings.Indent [width] [indent] | name | description | |------|-------------| -| `width` | _(optional)_ number of times to repeat the `indent` string. Default: `1` | -| `indent` | _(optional)_ the string to indent with. Default: `" "` | -| `input` | _(required)_ the string to indent | +| `width` | _(optional)_ Number of times to repeat the `indent` string. Must be greater than 0. Default: `1` | +| `indent` | _(optional)_ The string to indent with. Must not contain a newline character ("\n"). Default: `" "` | +| `input` | _(required)_ The string to indent | ### Examples -- cgit v1.2.3