2026-05-06 09:23 UTC
@anderseknert@hachyderm.io
It's embarrassing but I don't get the joke :-(
Is go so good (or bad) at error handling?
cc @anderseknert@swecyb.com
#Go #Erlang
Replies (2)
-
@rogerlipscombe@hachyderm.io 2026-05-06 09:33
@realn2s@infosec.exchange @anderseknert@hachyderm.io @anderseknert@swecyb.com Explaining the joke: It's referring to the fact that idiomatic Go requires you to scatter your code with `if err != nil {`. Whereas in idiomatic Erlang, you don't bother. You just implement the happy path and "let it crash" otherwise.
-
@Erwyn@mastodon.online 2026-05-06 09:33
@realn2s@infosec.exchange @anderseknert@hachyderm.io @anderseknert@swecyb.com I think it’s because `Err` are treated like standard values in Go, meaning for lots of calls to a function you have expect 2 results, the first on is the value, the second the `Err` and then check if the err is null to determine whether or not there was an issue https://go.dev/blog/error-handling-and-go