mirror of
https://gitclone.com/github.com/MetaCubeX/Clash.Meta
synced 2024-11-15 13:41:23 +08:00
9 lines
133 B
Go
9 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
|
|
}
|