github.com/igoogolx/clash@v1.19.8/common/util/manipulation.go (about)

     1  package util
     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  }