mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2024-11-16 19:56:51 +08:00
9 lines
134 B
Go
9 lines
134 B
Go
package utils
|
|
|
|
import "github.com/samber/lo"
|
|
|
|
func EmptyOr[T comparable](v T, def T) T {
|
|
ret, _ := lo.Coalesce(v, def)
|
|
return ret
|
|
}
|