3 ms·
The only benefit I can see in this, is that if each time I call GetError, it will give a useful list of conditions that were not met, so that in conditions wher
by alias_neo 8y ago
The only benefit I can see in this, is that if each time I call GetError, it will give a useful list of conditions that were not met, so that in conditions where fast-fail is not necessary, but letting the caller know everything that might have been incorrect, useful information is available.
If that's not the case (and it's not clear from any of the documentation), it seems like this adds no real value, and in my opinion actually makes the error handling ugly and harder to maintain.
Also, use package-defined, exported error types that you can refer to by name, and errors become useful data again like Go intended.
- storozhukBM 8y agoYou can actually return specific errors using verifier library. Check out documentation: https://godoc.org/github.com/storozhukBM/verifier#Verify.WithError https://godoc.org/github.com/storozhukBM/verifier#Verify.Wit...