Skip to content
This repository has been archived by the owner on Apr 5, 2023. It is now read-only.

mockstore: users should not have to populate the store's map entry in order to have it return the desired error #76

Open
llorllale opened this issue Oct 1, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@llorllale
Copy link
Contributor

If the user sets ErrGet on this store then the store's Get() operation should immediately return with that error.

func (s *MockStore) Get(k string) ([]byte, error) {
s.lock.RLock()
defer s.lock.RUnlock()
val, ok := s.Store[k]
if !ok {
return nil, storage.ErrValueNotFound
}
return val, s.ErrGet
}

@llorllale llorllale added the bug Something isn't working label Oct 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant