Skip to content

Commit

Permalink
interfaces: make GetBacked* take a Read instead of a Datastore
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Jan 31, 2019
1 parent f1971d0 commit cd8d7b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ var ErrInvalidType = errors.New("datastore: invalid type error")
// func (*d SomeDatastore) Has(key Key) (exists bool, err error) {
// return GetBackedHas(d, key)
// }
func GetBackedHas(ds Datastore, key Key) (bool, error) {
func GetBackedHas(ds Read, key Key) (bool, error) {
_, err := ds.Get(key)
switch err {
case nil:
Expand All @@ -228,7 +228,7 @@ func GetBackedHas(ds Datastore, key Key) (bool, error) {
// func (*d SomeDatastore) GetSize(key Key) (size int, err error) {
// return GetBackedSize(d, key)
// }
func GetBackedSize(ds Datastore, key Key) (int, error) {
func GetBackedSize(ds Read, key Key) (int, error) {
value, err := ds.Get(key)
if err == nil {
return len(value), nil
Expand Down

0 comments on commit cd8d7b4

Please # to comment.