4 ms·
To any Go programmers ignoring errors is insane. I haven't seen code outside of simple examples ignore errors, and even there it's discouraged.
by zalmoxes 10y ago
To any Go programmers ignoring errors is insane. I haven't seen code outside of simple examples ignore errors, and even there it's discouraged.
- deleted 10y ago[deleted]
- pmarreck 10y agoBut you still have to check for errors after every line of code where they are possible (if you're covering all the bases), no? Due to lack of a traditional exception model? Elixir/Erlang at least have pattern-matching which makes checks like that (from functions that return a non-OK value on errors) basically inlined: `{:ok, val} = call_some_func(with_args)` If it doesn't match on the :ok (i.e., an error occurred), you get a match error which gets logged, and the process typically gets killed and restarted by a supervisor process in a millisecond.