VOL-3978 - update to go 1.16.3
Change-Id: I4a1c78722b3e4019dfd288fa9c89b7d90924050a
diff --git a/vendor/github.com/opencord/voltha-lib-go/v4/pkg/db/kvstore/kvutils.go b/vendor/github.com/opencord/voltha-lib-go/v4/pkg/db/kvstore/kvutils.go
index 64e7d30..70bd977 100644
--- a/vendor/github.com/opencord/voltha-lib-go/v4/pkg/db/kvstore/kvutils.go
+++ b/vendor/github.com/opencord/voltha-lib-go/v4/pkg/db/kvstore/kvutils.go
@@ -15,7 +15,10 @@
*/
package kvstore
-import "fmt"
+import (
+ "bytes"
+ "fmt"
+)
// ToString converts an interface value to a string. The interface should either be of
// a string type or []byte. Otherwise, an error is returned.
@@ -42,3 +45,14 @@
return nil, fmt.Errorf("unexpected-type-%T", t)
}
}
+
+// Helper function to verify mostly whether the content of two interface types are the same. Focus is []byte and
+// string types
+func isEqual(val1 interface{}, val2 interface{}) bool {
+ b1, err := ToByte(val1)
+ b2, er := ToByte(val2)
+ if err == nil && er == nil {
+ return bytes.Equal(b1, b2)
+ }
+ return val1 == val2
+}