In the Go standard library source code, "panic" has pretty much the role 'assert(!"error message")' has in C.
The reality is that Go does not have exceptions the way Python does. If you're writing idiomatic Go, you're manually checking errors.
Exactly (and probably for a reason)
> In the Go standard library source code, "panic" has pretty much the role 'assert(!"error message")' has in C.
Well, there's no real way to recover after such an assert (the C stdlib is undefined when you catch the SIGABRT, the stack is not guaranteed to be big enough to do anything, most I/O is not guaranteed to work, etc. -- really, very few uses for catching a SIGABRT). There is a way in Go, even if it is far less capable than your average "except .." clause in C++.
> The reality is that Go does not have exceptions the way Python does.
True. Some of us (e.g. me) think that's a big advantage. (I'm not implying you disagree - I don't know what your opinion is)
I just find that so much more pleasant.
This means you can't continue to execute the function, but you do get a chance of handling the exception / turning it into a regular return value.
tl;dr: Go has exceptions, they are just a little different (IMO for the better).