mihomo/common/util/manipulation.go
2023-10-16 09:16:36 +08:00

8 lines
133 B
Go

package util
import "github.com/samber/lo"
func EmptyOr[T comparable](v T, def T) T {
ret, _ := lo.Coalesce(v, def)
return ret
}