speps / go-hashids

Go (golang) implementation of http://www.hashids.org
MIT License
1.32k stars 109 forks source link

Implement a wrapper function #39

Closed zitryss closed 6 years ago

zitryss commented 6 years ago

A wrapper function can be used in case when the inner function must succeed and errors are considered as programming mistakes.

zitryss commented 6 years ago

The same approach is used in some of the packages in standard library. See:

speps commented 6 years ago

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.