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

It's perfectly decent, it forces you to explicitly handle or ignore every error.

It's verbose as all hell, but on the other hand you'll notice immediately if it's missing.

Go is not a "fun" language by any means, but that doesn't mean it's not a productive one.



I don't see how it forces you to ignore? You don't have to be explicit to ignore the returned error code.


That's what the underscore is for, explicit ignore. And it's a huge code smell.

You instantly notice it because the if err != nil -template is missing after it =)


Sorry, I didn't word that well. What I meant is that you can ignore the returned value altogether, including the error.

https://github.com/golang/go/issues/20803

In contrast, e.g. Zig requires you to use _ if you want to ignore.




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

Search: