aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/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/filesystem/storage.go
parent91bf16b2336e6f80f0742be729582fe5fbbada83 (diff)
downloadgo-git-f6fe29c80d11662a169806dcf413ecdedcb28fa3.tar.gz
core: Storage, removing err returning *Storages
Diffstat (limited to 'storage/filesystem/storage.go')
-rw-r--r--storage/filesystem/storage.go20
1 files changed, 8 insertions, 12 deletions
diff --git a/storage/filesystem/storage.go b/storage/filesystem/storage.go
index 8f9c555..63d0215 100644
--- a/storage/filesystem/storage.go
+++ b/storage/filesystem/storage.go
@@ -22,25 +22,21 @@ func NewStorage(fs fs.FS, path string) (*Storage, error) {
return &Storage{dir: dir}, nil
}
-func (s *Storage) ObjectStorage() (core.ObjectStorage, error) {
+func (s *Storage) ObjectStorage() core.ObjectStorage {
if s.o != nil {
- return s.o, nil
+ return s.o
}
- i, err := buildIndex(s.dir)
- if err != nil {
- return nil, err
- }
-
- s.o = &ObjectStorage{dir: s.dir, index: i}
- return s.o, nil
+ //TODO: error being ignored
+ i, _ := buildIndex(s.dir)
+ return &ObjectStorage{dir: s.dir, index: i}
}
-func (s *Storage) ReferenceStorage() (core.ReferenceStorage, error) {
+func (s *Storage) ReferenceStorage() core.ReferenceStorage {
if s.r != nil {
- return s.r, nil
+ return s.r
}
s.r = &ReferenceStorage{dir: s.dir}
- return s.r, nil
+ return s.r
}