mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Merge pull request #33604 from hashicorp/crw-patch-1
This commit is contained in:
commit
52c7332d8a
@ -12,19 +12,19 @@ convert types automatically where required. Use the explicit type conversion
|
|||||||
functions only to normalize types returned in module outputs.
|
functions only to normalize types returned in module outputs.
|
||||||
|
|
||||||
Only the primitive types (string, number, and bool) and `null` can be converted to string.
|
Only the primitive types (string, number, and bool) and `null` can be converted to string.
|
||||||
All other values will produce an error.
|
`tostring(null)` produces a `null` value of type `string`. All other values produce an error.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
```
|
```
|
||||||
> tostring("hello")
|
> tostring("hello")
|
||||||
hello
|
"hello"
|
||||||
> tostring(1)
|
> tostring(1)
|
||||||
1
|
"1"
|
||||||
> tostring(true)
|
> tostring(true)
|
||||||
true
|
"true"
|
||||||
> tostring(null)
|
> tostring(null)
|
||||||
null
|
tostring(null)
|
||||||
> tostring([])
|
> tostring([])
|
||||||
Error: Invalid function argument
|
Error: Invalid function argument
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user