terraform/lang/funcs
Kristin Laemmert d4669246c7
funcs/coalesce: return the first non-null, non-empty-string element from a sequence (#21002)
* funcs/coalesce: return the first non-null, non-empty element from a
sequence.

The go-cty coalesce function, which was originally used here, returns the
first non-null element from a sequence. Terraform 0.11's coalesce,
however, returns the first non-empty string from a list of strings.

This new coalesce function aims to preserve terraform's documented
functionality while adding support for additional argument types. The
tests include those in go-cty and adapted tests from the 0.11 version of
coalesce.

* website/docs: update coalesce function document
2019-04-12 13:57:52 -04:00
..
testdata lang/funcs: templatefile function 2018-12-21 08:06:14 -08:00
cidr.go port compact function 2018-10-16 18:49:20 -07:00
cidr_test.go port cidr functions 2018-10-16 18:49:20 -07:00
collection.go funcs/coalesce: return the first non-null, non-empty-string element from a sequence (#21002) 2019-04-12 13:57:52 -04:00
collection_test.go funcs/coalesce: return the first non-null, non-empty-string element from a sequence (#21002) 2019-04-12 13:57:52 -04:00
conversion.go lang/funcs: Type conversion functions 2019-01-17 10:01:47 -08:00
conversion_test.go lang/funcs: Type conversion functions 2019-01-17 10:01:47 -08:00
crypto.go lang/funcs: Fix filebase64sha256 function hashing algorithm 2019-03-12 12:59:36 -04:00
crypto_test.go lang/funcs: Fix filebase64sha256 function hashing algorithm 2019-03-12 12:59:36 -04:00
datetime.go cleanup comments for nicer godocs 2018-10-16 18:49:20 -07:00
datetime_test.go cleanup comments for nicer godocs 2018-10-16 18:49:20 -07:00
encoding.go base64decode: check that the decoded (not encoded) string is valid UTF-8 2018-10-16 18:49:20 -07:00
encoding_test.go base64decodeFunc now checks for valid UTF-8 2018-10-16 18:49:20 -07:00
filesystem.go lang/funcs: Fix out-of-bounds ArgError in templatefile function 2019-03-19 16:23:51 -07:00
filesystem_test.go lang/funcs: Fix out-of-bounds ArgError in templatefile function 2019-03-19 16:23:51 -07:00
number.go porting functions 2018-10-16 18:49:20 -07:00
number_test.go porting functions 2018-10-16 18:49:20 -07:00
string.go lang/funcs: Fix panic in "join" when an element is null 2019-02-07 14:35:13 -08:00
string_test.go porting many functions 2018-10-16 18:49:20 -07:00