Remove String function 05/102605/1
authorRitu Sood <ritu.sood@intel.com>
Fri, 28 Feb 2020 22:34:28 +0000 (14:34 -0800)
committerRitu Sood <ritu.sood@intel.com>
Fri, 28 Feb 2020 22:34:28 +0000 (14:34 -0800)
Removing String from interface as this is
not required anymore

Issue-ID: MULTICLOUD-1001
Signed-off-by: Ritu Sood <ritu.sood@intel.com>
Change-Id: I40a950bb343f4cfcc5d51e52e44d0f788fc5e303

src/orchestrator/pkg/infra/db/mock.go
src/orchestrator/pkg/infra/db/store.go

index afa4b02..6b46a52 100644 (file)
@@ -15,6 +15,7 @@ package db
 
 import (
        "encoding/json"
+       "fmt"
 
        pkgerrors "github.com/pkg/errors"
 )
@@ -62,8 +63,9 @@ func (m *MockDB) Read(table string, key Key, tag string) ([]byte, error) {
                return nil, m.Err
        }
 
+       str := fmt.Sprintf("%v", key)
        for k, v := range m.Items {
-               if k == key.String() {
+               if k == str {
                        return v[tag], nil
                }
        }
index c8a8f74..0cf3ef6 100644 (file)
@@ -29,7 +29,6 @@ var DBconn Store
 // that wants to use the Store interface. This allows various
 // db backends and key types.
 type Key interface {
-       String() string
 }
 
 // Store is an interface for accessing the database