diff --git a/pkg/other/other.go b/pkg/other/other.go index ebc1c3a..98e940e 100644 --- a/pkg/other/other.go +++ b/pkg/other/other.go @@ -6,3 +6,10 @@ package other func OutputIntoChannel[T any](out T, target chan T) { target <- out } + +func Must[T any](val T, err error) T { + if err != nil { + panic(err) + } + return val +}