Skip to content
Snippets Groups Projects
compare.go 324 B
Newer Older
Francé Wilke's avatar
Francé Wilke committed
package compare

import "reflect"

// PointerValuesChanged returns true when new is defined and has a different value than old
func PointerValuesChanged(old, new interface{}) bool {
	if new != nil {
		if old != nil {
			if !reflect.DeepEqual(old, new) {
				return true
			}
		} else {
			return true
		}
	}
	return false
}