mihomo/common/utils/manipulation.go

9 lines
134 B
Go
Raw Permalink Normal View History

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