Skip to content

Comment on Discussion: Reduce error handling boilerplate in Golang using '?'parent

Comments

This is probably the one that would anger Golangers the most lol

They could even have typed error checking for different errors and an automatic return error syntax.

    { Foo }
    catch (err) {}
    catch (err2){}
    throw

Agreed. The reduction in boilerplate to route error conditions is what we really need, if we are going to add any special error concept. errors.Is/errors.As and the accompanying switch/if statements can quickly consume entire screens of code for all but the most simplest of failure cases and as a result it often sees developers become lazy and just return err instead.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.