aboutsummaryrefslogtreecommitdiffstats
path: root/examples/storage/storage.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-31 19:54:49 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-31 19:54:49 +0200
commita82239a71a2cfc7a55af253d11c28fcec73a3039 (patch)
treecb8e363f6317d04fc24e8bc5ea610bbf5131592b /examples/storage/storage.go
parent587d380585c08e9b5f839d06df0f0c7bd32218cf (diff)
downloadgo-git-a82239a71a2cfc7a55af253d11c28fcec73a3039.tar.gz
example: improvements on the storage example
Diffstat (limited to 'examples/storage/storage.go')
-rw-r--r--examples/storage/storage.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/storage/storage.go b/examples/storage/storage.go
index 2231f95..48b3dcd 100644
--- a/examples/storage/storage.go
+++ b/examples/storage/storage.go
@@ -2,7 +2,6 @@ package main
import (
"encoding/json"
- "fmt"
"io"
"io/ioutil"
@@ -108,7 +107,11 @@ func (s *AerospikeObjectStorage) Get(t core.ObjectType, h core.Hash) (core.Objec
return nil, err
}
- return nil, core.ErrObjectNotFound
+ if rec == nil {
+ return nil, core.ErrObjectNotFound
+ }
+
+ return objectFromRecord(rec, t)
}
func (s *AerospikeObjectStorage) Iter(t core.ObjectType) (core.ObjectIter, error) {
@@ -125,7 +128,6 @@ func (s *AerospikeObjectStorage) Iter(t core.ObjectType) (core.ObjectIter, error
func (s *AerospikeObjectStorage) keyFromObject(h core.Hash, t core.ObjectType,
) (*aerospike.Key, error) {
- fmt.Println(t.String())
return aerospike.NewKey(s.ns, t.String(), h.String())
}