Skip to content

Commit

Permalink
fix(allsrv): fixup false not found error in delete foo API
Browse files Browse the repository at this point in the history
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!
  • Loading branch information
jsteenb2 committed Jul 5, 2024
1 parent 6a573b2 commit ec22efa
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions allsrv/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
10) Observability....
✅11) hard coding UUID generation into db
12) possible race conditions in inmem store
✅13) there is a bug in the delete foo inmem db implementation
Praises:
1) minimal public API
Expand Down Expand Up @@ -215,6 +216,7 @@ func (db *InmemDB) delFoo(id string) error {
for i, f := range db.m {
if id == f.ID {
db.m = append(db.m[:i], db.m[i+1:]...)
return nil // 13)
}
}
return errors.New("foo not found for id: " + id) // 8)
Expand Down

0 comments on commit ec22efa

Please sign in to comment.