mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-01 11:47:07 -06:00
helper/schema: default the new value to zero only for the decode
This commit is contained in:
parent
ad6be99f5b
commit
bcdec738d4
@ -810,13 +810,14 @@ func (m schemaMap) diffString(
|
||||
originalN = n
|
||||
n = schema.StateFunc(n)
|
||||
}
|
||||
if n == nil {
|
||||
n = schema.Type.Zero()
|
||||
nraw := n
|
||||
if nraw == nil {
|
||||
nraw = schema.Type.Zero()
|
||||
}
|
||||
if err := mapstructure.WeakDecode(o, &os); err != nil {
|
||||
return fmt.Errorf("%s: %s", k, err)
|
||||
}
|
||||
if err := mapstructure.WeakDecode(n, &ns); err != nil {
|
||||
if err := mapstructure.WeakDecode(nraw, &ns); err != nil {
|
||||
return fmt.Errorf("%s: %s", k, err)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user