opentofu/helper/structure/suppress_json_diff.go
2017-03-28 12:59:46 +01:00

22 lines
364 B
Go

package structure
import (
"reflect"
"github.com/hashicorp/terraform/helper/schema"
)
func SuppressJsonDiff(k, old, new string, d *schema.ResourceData) bool {
oldMap, err := ExpandJsonFromString(old)
if err != nil {
return false
}
newMap, err := ExpandJsonFromString(new)
if err != nil {
return false
}
return reflect.DeepEqual(oldMap, newMap)
}