From ec22efa0f49cdb8bc0daab6f5add7a62affec467 Mon Sep 17 00:00:00 2001 From: Johnny Steenbergen Date: Sat, 13 Jan 2024 19:16:50 -0600 Subject: [PATCH] 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! --- allsrv/server.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/allsrv/server.go b/allsrv/server.go index cf3f92f..fb92041 100644 --- a/allsrv/server.go +++ b/allsrv/server.go @@ -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 @@ -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)