[VOL-3801] remove unused KV consul code in voltha-lib-go
Change-Id: Iedfd7c24440692d74c8f463d80f3ad259cbf2e6d
diff --git a/pkg/db/kvstore/kvutils.go b/pkg/db/kvstore/kvutils.go
index 64e7d30..70bd977 100644
--- a/pkg/db/kvstore/kvutils.go
+++ b/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
+}