5 ms·
As I don't program in Go this might be wrong, but doesn't the programmer have to tell the Go compiler to ignore the error by using the _ variable thing? In tha
by jussij 13y ago
As I don't program in Go this might be wrong, but doesn't the programmer have to tell the Go compiler to ignore the error by using the _ variable thing?
In that sense Go is still forcing the programmer to handle the error and it is the programmer who is deciding to ignore it.
I can see making the programmer do nothing more than mark the error as ignored still forces the programmer to think about the error and as such adds some value.
- AYBABTME 13y agoUnless you ignore all returned values: func Something() (a, bunch, of, stuff) { // stuff } ... _, _, _, _ = Something() Something() Both are valid.
- deleted 13y ago[deleted]
- jussij 13y agoThanks for that. I would have though that in a language all about error checking this would not be allowed: Something() But there you go, I've learnt something new about Go.
- masklinn 13y ago> in a language all about error checking Go is not one such language, that's one of the numerous go myths completely disconnected from reality.