mihomo/common/utils/must.go
2023-03-11 12:23:27 +08:00

9 lines
114 B
Go

package utils
func MustOK[T any](result T, ok bool) T {
if ok {
return result
}
panic("operation failed")
}