diff options
Diffstat (limited to 'internal/provider/utils.go')
-rw-r--r-- | internal/provider/utils.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/internal/provider/utils.go b/internal/provider/utils.go new file mode 100644 index 0000000..3b1b665 --- /dev/null +++ b/internal/provider/utils.go @@ -0,0 +1,17 @@ +package provider + +import ( + "encoding/json" + "reflect" +) + +func JSONRawDataEqual(a, b json.RawMessage) (bool, error) { + var j, j2 interface{} + if err := json.Unmarshal([]byte(a), &j); err != nil { + return false, err + } + if err := json.Unmarshal([]byte(b), &j2); err != nil { + return false, err + } + return reflect.DeepEqual(j2, j), nil +} |