rename trim to trimspace

pull/4910/head
Colin Hebert 10 years ago
parent d45b7b2ddc
commit d92d205dd9

@ -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
},
}
}

@ -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.

Loading…
Cancel
Save