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

I suppose it becomes part of the signature of the caller, so maybe? I guess I was thinking "locally at the call site, I don't see anything corresponding to `if err != nil { return err }`", but implicit vs explicit error handling probably isn't well-defined, so I suppose it's up to interpretation. I usually think of it more in a local context ("is it evident right at the call site") but the caller's function signature is certainly local-ish. (shrug)


At the call site you will get a compile error. And the signature of the method you call explicitly tells you what errors you need to handle.

Most IDEs will conveniently put a red squiggle line beneath the exact call site as well, and show you the compile error when you hover over it.

And if you choose to rethrow it, you will need to add to your method an explicit annotation.




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

Search: