Browse Source

libnetwork/datastore: move MockData to a _test file

It's only used in tests, and only within this package.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Sebastiaan van Stijn 2 years ago
parent
commit
d5b1e43b8f
1 changed files with 2 additions and 6 deletions
  1. 2 6
      libnetwork/datastore/mockstore_test.go

+ 2 - 6
libnetwork/datastore/mock_store.go → libnetwork/datastore/mockstore_test.go

@@ -7,9 +7,6 @@ import (
 	"github.com/docker/docker/libnetwork/types"
 )
 
-// ErrNotImplemented exported
-var ErrNotImplemented = errors.New("Functionality not implemented")
-
 // MockData exported
 type MockData struct {
 	Data  []byte
@@ -23,8 +20,7 @@ type MockStore struct {
 
 // NewMockStore creates a Map backed Datastore that is useful for mocking
 func NewMockStore() *MockStore {
-	db := make(map[string]*MockData)
-	return &MockStore{db}
+	return &MockStore{db: make(map[string]*MockData)}
 }
 
 // Get the value at "key", returns the last modified index
@@ -56,7 +52,7 @@ func (s *MockStore) Exists(key string) (bool, error) {
 
 // List gets a range of values at "directory"
 func (s *MockStore) List(prefix string) ([]*store.KVPair, error) {
-	return nil, ErrNotImplemented
+	return nil, errors.New("not implemented")
 }
 
 // AtomicPut put a value at "key" if the key has not been