-
Handled all error conditions?
Have you checked each error and handled or propagated upstream? -
Returned appropriate error code
Please return proper error code & detailed error message to callers.msg := fmt.Printf("[fname] failed in Redis Set err=%s ret=%d", err, ret) ret errRedis
-
Added logs for each failure
It will help you narrow down the trouble code. -
Successful build with lint
lint
keeps your code clean. -
Formatting fixes (gofmt)
Always follow the coding standard of the language, especially symbol names. -
Code reviews by at least two people.
-
Unit Testing (docker compose)
UT is easy and catches stupid bugs. There are many ways to test the code. The easiest is just the functions you’ve added. Stub any call you don’t or can’t test. -
Scale testing (for finding a resource such as sockets, memory leaks)
UT is ineffective catching serial and slow bugs. These are the most troublesome problems that can be caught using heavy load & volume testing -
Staging deployment
-
Finally, live on production 🙂
Advertisements