aboutsummaryrefslogtreecommitdiff
path: root/internal/provider/utils.go
diff options
context:
space:
mode:
authorJulien Dessaux2023-09-25 00:06:41 +0200
committerJulien Dessaux2023-09-25 00:13:49 +0200
commit68326c685fb6257220845195fd9cb5cbb3907f06 (patch)
tree93ffe1bbf10371e95fd46d02b3b5e531001f4622 /internal/provider/utils.go
parentFixed various documentation entries (diff)
downloadterraform-provider-eventline-68326c685fb6257220845195fd9cb5cbb3907f06.tar.gz
terraform-provider-eventline-68326c685fb6257220845195fd9cb5cbb3907f06.tar.bz2
terraform-provider-eventline-68326c685fb6257220845195fd9cb5cbb3907f06.zip
Fixed identity resource RawData idempotency
Diffstat (limited to '')
-rw-r--r--internal/provider/utils.go17
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
+}