Skip to content

Commit

Permalink
2024-07-29/02: add must2
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Jul 30, 2024
1 parent 5b2d243 commit 8ded84a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion 2024-07-29/02-go-a-reasonable-good-language.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ func must1[T any](v T, err error) T {
return v
}

// must2, must3, etc...
func must2[T1 any, T2 any](v1 T1, v2 T2, err error) T {
must(err)
return v1, v2
}

// must3, must4, etc...
```

Those functions are so useful, especially for scripts where I generally don't
Expand Down

0 comments on commit 8ded84a

Please sign in to comment.