mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-29 10:21:01 -06:00
cec4578005
This is a new part of the existing module_variable_optional_attrs experiment, because it's intended to complement the ability to declare an input variable whose type constraint is an object type with optional attributes. Module authors can use this to replace null values (that were either explicitly set or implied by attribute omission) with other non-null values of the same type. This function is a bit more type-fussy than our functions typically are because it's intended for use primarily with input variables that have fully-specified type constraints, and thus it uses that type information to help inform how the defaults data structure should be interpreted. Other uses of this function will probably be harder today because it takes a lot of extra annotation to build a value of a specific type if it isn't passing through a variable type constraint. Perhaps later language features for more general type conversion will make this more applicable, but for now the more general form of this problem is better solved other ways. |
||
---|---|---|
.. | ||
testdata | ||
cidr_test.go | ||
cidr.go | ||
collection_test.go | ||
collection.go | ||
conversion_test.go | ||
conversion.go | ||
crypto_test.go | ||
crypto.go | ||
datetime_test.go | ||
datetime.go | ||
defaults_test.go | ||
defaults.go | ||
encoding_test.go | ||
encoding.go | ||
filesystem_test.go | ||
filesystem.go | ||
number_test.go | ||
number.go | ||
string_test.go | ||
string.go |