StorageWithError can be used to introduce various errors in a storage operation during unit testing.
| 26 | |
| 27 | // StorageWithError can be used to introduce various errors in a storage operation during unit testing. |
| 28 | type StorageWithError struct { |
| 29 | CreateErr error |
| 30 | SaveErr error |
| 31 | UpdateErr error |
| 32 | GetErr error |
| 33 | ListErr error |
| 34 | RawErr error |
| 35 | CountRes int64 |
| 36 | CountErr error |
| 37 | DeleteErr error |
| 38 | } |
| 39 | |
| 40 | func (s *StorageWithError) Create(_ any) error { return s.CreateErr } |
| 41 | func (s *StorageWithError) Save(_ any, _ ...any) error { return s.SaveErr } |
nothing calls this directly
no outgoing calls
no test coverage detected