aboutsummaryrefslogtreecommitdiffstats
path: root/storage/memory/storage.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-14 18:21:10 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-14 18:21:10 +0200
commitf6fe29c80d11662a169806dcf413ecdedcb28fa3 (patch)
tree9958034c27521f720f8c5d83c12120ada196f48a /storage/memory/storage.go
parent91bf16b2336e6f80f0742be729582fe5fbbada83 (diff)
downloadgo-git-f6fe29c80d11662a169806dcf413ecdedcb28fa3.tar.gz
core: Storage, removing err returning *Storages
Diffstat (limited to 'storage/memory/storage.go')
-rw-r--r--storage/memory/storage.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/storage/memory/storage.go b/storage/memory/storage.go
index 9c97523..32c2973 100644
--- a/storage/memory/storage.go
+++ b/storage/memory/storage.go
@@ -20,9 +20,9 @@ func NewStorage() *Storage {
}
// ObjectStorage returns the ObjectStorage if not exists creates a new one
-func (s *Storage) ObjectStorage() (core.ObjectStorage, error) {
+func (s *Storage) ObjectStorage() core.ObjectStorage {
if s.o != nil {
- return s.o, nil
+ return s.o
}
s.o = &ObjectStorage{
@@ -33,19 +33,19 @@ func (s *Storage) ObjectStorage() (core.ObjectStorage, error) {
Tags: make(map[core.Hash]core.Object, 0),
}
- return s.o, nil
+ return s.o
}
// ReferenceStorage returns the ReferenceStorage if not exists creates a new one
-func (s *Storage) ReferenceStorage() (core.ReferenceStorage, error) {
+func (s *Storage) ReferenceStorage() core.ReferenceStorage {
if s.r != nil {
- return s.r, nil
+ return s.r
}
r := make(ReferenceStorage, 0)
s.r = &r
- return s.r, nil
+ return s.r
}
// ObjectStorage is the implementation of core.ObjectStorage for memory.Object