github.com/wikibal01/hashicorp-terraform@v0.11.12-beta1/helper/structure/suppress_json_diff.go (about)

     1  package structure
     2  
     3  import (
     4  	"reflect"
     5  
     6  	"github.com/hashicorp/terraform/helper/schema"
     7  )
     8  
     9  func SuppressJsonDiff(k, old, new string, d *schema.ResourceData) bool {
    10  	oldMap, err := ExpandJsonFromString(old)
    11  	if err != nil {
    12  		return false
    13  	}
    14  
    15  	newMap, err := ExpandJsonFromString(new)
    16  	if err != nil {
    17  		return false
    18  	}
    19  
    20  	return reflect.DeepEqual(oldMap, newMap)
    21  }