github.com/metacubex/mihomo@v1.18.5/common/utils/manipulation.go (about)

     1  package utils
     2  
     3  import "github.com/samber/lo"
     4  
     5  func EmptyOr[T comparable](v T, def T) T {
     6  	ret, _ := lo.Coalesce(v, def)
     7  	return ret
     8  }