|
|
|
|
|
by fiatjaf
3212 days ago
|
|
In Go there are two ways you can handle wrong things happening: - 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. |
|