filecoin-project / go-amt-ipld

Implementation of an array mapped trie using go and ipld
Other
9 stars 15 forks source link

Replace ErrNotFound with additional boolean return value #41

Closed anorth closed 3 years ago

anorth commented 3 years ago

The Get operation returns a ErrNotFound error type (not a sentinel value) if the key is not found. This is a somewhat inconvenient pattern for callers, and the higher level actor code adapts it to distinguish actual errors from key-not-found information.

Change the return type to (bool, error) (with the value being written to the out parameter).

See also https://github.com/filecoin-project/go-hamt-ipld/issues/82

anorth commented 3 years ago

Closed by #45