mihomo/common/utils/must.go

9 lines
114 B
Go
Raw Normal View History

2023-03-11 12:23:27 +08:00
package utils
func MustOK[T any](result T, ok bool) T {
if ok {
return result
}
panic("operation failed")
}