3 ms·
I agree and I've been thinking about this in general (not only in the context of go, but for programming in general). I've settled on "caller adds context" beca
by jjnoakes 3y ago
I agree and I've been thinking about this in general (not only in the context of go, but for programming in general). I've settled on "caller adds context" because it is only the caller who knows if the error can be handled immediately (in which case no context is needed and we save the extra effort of creating it) or if the error should be propagated up, and how (should it be wrapped with context, wrapped in another struct, replaced with a different struct, etc).