Skip to content

Add Must* versions of methods that return error #87

@jpap

Description

@jpap

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions