mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-25 08:21:07 -06:00
650380f3ae
The optional modifier previously accepted a single argument: the attribute type. This commit adds an optional second argument, which specifies a default value for the attribute. To record the default values for a variable's type, we use a separate parallel structure of `typeexpr.Defaults`, rather than extending `cty.Type` to include a `cty.Value` of defaults (which may in turn include a `cty.Type` with defaults, and so on, and so forth). The new `typeexpr.TypeConstraintWithDefaults` returns a type constraint and defaults value. Defaults will be `nil` unless there are default values specified somewhere in the variable's type. |
||
---|---|---|
.. | ||
defaults_test.go | ||
defaults.go | ||
doc.go | ||
get_type_test.go | ||
get_type.go | ||
public.go | ||
type_string_test.go | ||
type_type_test.go | ||
type_type.go |