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 }