--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/ZdcDz2ULDQl02Z3R%40arp.lijzij.de.
I’m biased as well. FWIW, this is a subpackage of the error handling solution, err2.
The assertion pkg is proven to be a precious tool for many projects. It is unique because it can be used both for the test and production code runs. You’ll set, e.g., assert.NotEmpty(s) in whatever function you need. It’ll be checked in test runs and regular main() started runs. And all of this is done automatically.
For instance, if a currently tested function A calls a function B that uses this assertion package and violates assertion, the test fails in function A’s caller. Still, you get the whole location list to the call stack no matter how deep the call stack is to the function B. This works even over Go module boundaries, but you need help with the error result listing, e.g., the Vim plugin.
Naturally, the happy path performance has been necessary, and, e.g., assert.That is the same as if condition.