Closed zitryss closed 6 years ago
The same approach is used in some of the packages in standard library. See:
You can do that in your code base if it's needed. The library itself shouldn't provide this. It's done like that in other libraries because Go doesn't have generics.
A wrapper function can be used in case when the inner function must succeed and errors are considered as programming mistakes.