peterbourgon / diskv

A disk-backed key-value store.
http://godoc.org/github.com/peterbourgon/diskv
MIT License
1.41k stars 102 forks source link

Exists & IsNotExist #4

Closed icholy closed 11 years ago

icholy commented 11 years ago

Added a simpler way of checking if keys exist.

peterbourgon commented 11 years ago

Thanks for the idea! I implemented it slightly differently.

icholy commented 11 years ago

is there ever a time when Read returns an error that isn't a result of the key not existing?

peterbourgon commented 11 years ago

Sure,

peterbourgon commented 11 years ago

And, nicely: Go's unambiguous error idioms make constructing this list of 100% of the failure cases in Read trivial.