clash/common/util/manipulation.go

9 lines
133 B
Go
Raw Normal View History

2023-08-03 22:51:12 +08:00
package util
import "github.com/samber/lo"
func EmptyOr[T comparable](v T, def T) T {
ret, _ := lo.Coalesce(v, def)
return ret
}