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 an Append function for easier usage of merror #1

Merged
merged 2 commits into from
Aug 17, 2022

Conversation

noxer
Copy link

@noxer noxer commented Aug 15, 2022

This PR adds an Append function to the package itself. It checks if the first argument is already a *MError and turns it into one if not. It also ignores nil errors which allows very easy usage in loops.

var err error
for _, thing := range things {
    err = merror.Append(err, thing.Do())
}

@wiggin77 wiggin77 merged commit 673e356 into wiggin77:master Aug 17, 2022
@wiggin77
Copy link
Owner

Thanks @noxer. This is merged and a release published. You'll need to upgrade to v1.0.4

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

Successfully merging this pull request may close these issues.

2 participants