This is my own iteration that build upon PeterRk's proposal. https://gist.github.com/PeterRK/4f59579c1162cdbc28086f6b5f7b4fa2
The idea is to reduce if err != nil {}
boilerplate while not encouraging developers to write lazy error handling.
For me, this means:
- Add as little syntax as possible
- Be as explicit as convenient
The user PeterRk proposed the next syntax:
func getDivisorFromDB(key string) (uint, error) {