MustResult¶
func MustResult[T any](value T, err error, messages ...string) T
MustResult panics if the error is not nil, otherwise returns the result. This is useful for cases where an error should never occur and you want to fail fast. The optional messages are formatted and included in the panic message.