11 lines
152 B
Go
11 lines
152 B
Go
package defaults
|
|
|
|
func Coalesce[T comparable](variables ...T) (result T) {
|
|
for _, v := range variables {
|
|
if !Empty(v) {
|
|
return v
|
|
}
|
|
}
|
|
return
|
|
}
|