Skip to content

Commit ec22efa

Browse files
committed
fix(allsrv): fixup false not found error in delete foo API
The tests should now pass. Without the test, this isn't immediately obvious. Point in case, I didn't realize I missed this until I wrote the test in the previous commit. That's why you won't find it in the list of concerns!
1 parent 6a573b2 commit ec22efa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

allsrv/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import (
3636
10) Observability....
3737
✅11) hard coding UUID generation into db
3838
12) possible race conditions in inmem store
39+
✅13) there is a bug in the delete foo inmem db implementation
3940
4041
Praises:
4142
1) minimal public API
@@ -215,6 +216,7 @@ func (db *InmemDB) delFoo(id string) error {
215216
for i, f := range db.m {
216217
if id == f.ID {
217218
db.m = append(db.m[:i], db.m[i+1:]...)
219+
return nil // 13)
218220
}
219221
}
220222
return errors.New("foo not found for id: " + id) // 8)

0 commit comments

Comments
 (0)