From d92d205dd939fda2f02380ecb0782225942a34da Mon Sep 17 00:00:00 2001 From: Colin Hebert Date: Sat, 30 Jan 2016 20:51:28 +1100 Subject: [PATCH] rename trim to trimspace --- config/interpolate_funcs.go | 8 ++++---- website/source/docs/configuration/interpolation.html.md | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/interpolate_funcs.go b/config/interpolate_funcs.go index 5d5e6f6e2e..85e69e14c5 100644 --- a/config/interpolate_funcs.go +++ b/config/interpolate_funcs.go @@ -41,7 +41,7 @@ func Funcs() map[string]ast.Function { "split": interpolationFuncSplit(), "sha1": interpolationFuncSha1(), "sha256": interpolationFuncSha256(), - "trim": interpolationFuncTrim(), + "trimspace": interpolationFuncTrimSpace(), "base64encode": interpolationFuncBase64Encode(), "base64decode": interpolationFuncBase64Decode(), "upper": interpolationFuncUpper(), @@ -619,13 +619,13 @@ func interpolationFuncSha256() ast.Function { } } -func interpolationFuncTrim() ast.Function { +func interpolationFuncTrimSpace() ast.Function { return ast.Function{ ArgTypes: []ast.Type{ast.TypeString}, ReturnType: ast.TypeString, Callback: func(args []interface{}) (interface{}, error) { - trim := args[0].(string) - return strings.TrimSpace(trim), nil + trimSpace := args[0].(string) + return strings.TrimSpace(trimSpace), nil }, } } diff --git a/website/source/docs/configuration/interpolation.html.md b/website/source/docs/configuration/interpolation.html.md index e43f524b3a..b1f2b9fe60 100644 --- a/website/source/docs/configuration/interpolation.html.md +++ b/website/source/docs/configuration/interpolation.html.md @@ -176,7 +176,7 @@ The supported built-in functions are: `a_resource_param = ["${split(",", var.CSV_STRING)}"]`. Example: `split(",", module.amod.server_ids)` - * `trim(string)` - Returns a copy of the string with all leading and trailing white spaces removed. + * `trimspace(string)` - Returns a copy of the string with all leading and trailing white spaces removed. * `upper(string)` - Returns a copy of the string with all Unicode letters mapped to their upper case.