Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

People downvote it, but it's true. 2/3 of your Go code is `if err` blocks. And the way you have to chain the error messages to make the stack make any kind of sense is just maddening.


I used to really hate that. After reading this amazing post https://middlemost.com/failure-is-your-domain I created a module that makes this bearable https://github.com/Vanclief/ez


We often have errors handled. In contrast to many Java codes just spitting unhandled exception stacktraces or crashing completely.


You must handle an exception in a language like Java. Yes, you can just print the stacktrace, but that is a choice. I don't HAVE to handle errors in Go until the program crashes as well. I never really understood that argument.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: