I'm now wondering if the type system can be leveraged in Go to achieve similar though. Instead of returning an error, you could return a ServiceSpecificError interface and then ensure your error types all implement it.
The problem is you can't then use something like errors.New() to create them :(
The problem is you can't then use something like errors.New() to create them :(
Comments