4 ms·
Make a decision to or forget to check error codes. My gripe is fairly different from the OP's in this aspect. Go is inconsistent. For functions that return v
by sbov 14y ago
Make a decision to or forget to check error codes.
My gripe is fairly different from the OP's in this aspect. Go is inconsistent. For functions that return values I need to use, I will be warned by the compiler if I forget to handle the error. For those that don't, the compiler will happily let me accidentally ignore the error.
I'd rather require that all return values be handled whether I use them or not. For the rare case that a function returns a value I honestly don't care about, I can just use _. At least I'm not hiding the fact that I knowingly am ignoring stuff.
(Edit: despite the above, I still do enjoy using Go.)
- drivebyacct2 14y agoI can understand why that inconsistency is frustrating. Similarly: typedObj, err = something.(type) typedObj = something.(type) obj = someMap[key] obj, ok = someMap[key]
- zeeboo 14y agoIt's typedObj, ok = something.(type) just like it is with maps, or any other ", ok" thing. http://play.golang.org/p/I-5kD88knC http://play.golang.org/p/I-5kD88knC
- drivebyacct2 14y agoOi vey, mea culpa.