aboutsummaryrefslogtreecommitdiff
path: root/util.go
blob: 34cf28b8a836b3843b46aa08baf973f62be9dfb1 (plain)
1
2
3
4
5
6
7
8
9
package core

// Must panics if err is not nil. It returns val otherwise.
func Must[T any](val T, err error) T {
	if err != nil {
		panic(err)
	}
	return val
}