// Equal checks the equality of two resource configs.
Equal checks the equality of two resource configs.
// Equal checks the equality of two resource configs .
func (c *ResourceConfig) Equal(c2 *ResourceConfig) bool {
	if c == nil || c2 == nil {
		return c == c2
	}
	sort.Strings(c.ComputedKeys)
	sort.Strings(c2.ComputedKeys)
	check := [][2]interface{}{
		{c.ComputedKeys, c2.ComputedKeys},
		{c.Raw, c2.Raw},
		{c.Config, c2.Config},
	}
	for _, pair := range check {
		if !reflect.DeepEqual(pair[0], pair[1]) {
			return false
		}
	}
	return true
}
func ( c * ResourceConfig ) Equal ( c2 * ResourceConfig ) bool { if c == nil || c2 == nil { return c == c2 } sort . Strings ( c . ComputedKeys ) sort . Strings ( c2 . ComputedKeys ) check := [ ] [ 2 ] interface { } { { c . ComputedKeys , c2 . ComputedKeys } , { c . Raw , c2 . Raw } , { c . Config , c2 . Config } , } for _ , pair := range check { if ! reflect . DeepEqual ( pair [ 0 ] , pair [ 1 ] ) { return false } } return true }
Equal checks the equality of two resource configs.
Equal checks the equality of two resource configs .
// If either are nil, then they're only equal if they're both nil // Sort the computed keys so they're deterministic // Two resource configs if their exported properties are equal. // We don't compare "raw" because it is never used again after // initialization and for all intents and purposes they are equal // if the exported properties are equal.