Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Must* versions of methods that return error #87

Open
jpap opened this issue May 20, 2021 · 0 comments
Open

Add Must* versions of methods that return error #87

jpap opened this issue May 20, 2021 · 0 comments

Comments

@jpap
Copy link

jpap commented May 20, 2021

Thanks for a great package!

It would be quite convenient to have methods on Money that panic instead of returning error. These could wrap the existing methods, with the Must prefix. For example, MustAdd would wrap Money.Add.

In my program, for example, I deal with just one currency (and am using go-money for correct handling of cents in the dollar). The ability to avoid explicit error checking, and use the result of Add, Subtract, etc. as an unary expression would be very helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant