by fiatjaf · 8y ago · 0 comments
- return an error
- panic
What is the recommended, best, pretty, beautiful way? Return an error. Nobody uses panic.Javascript Promises are equivalent to that.
If you want to stop the main program, call process.exit(). That would be the equivalent of panic.
Chaining functions is for functional people. Go is proudly imperative.