Skip to content

Conversation

@hpidcock
Copy link
Member

This adds a series of Must helpers that call a function on your behalf and
assert that the final error return value is nil. It will then return any remaining
return values to the caller of Must.

uuid := tc.Must(c, model.NewUUID)

Must has a series of forms available, MustX which takes X arguments to
pass to the function being called, returning a single argument. The MustX
series are aliases of the MustX_1 series. MustX_Y all take X arguments
and return Y values. The Must function is the most common case, a
function that takes no arguments, returns one value and an error.

Copy link
Member

@SimonRichardson SimonRichardson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is better.

@hpidcock hpidcock merged commit eb19861 into main Aug 19, 2025
0 of 6 checks passed
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.

3 participants