github.com/isyscore/isc-gobase@v1.5.3-0.20231218061332-cbc7451899e9/isc/ifthen.go (about)

     1  package isc
     2  
     3  func IfThen[T any](condition bool, trueVal T, falseVal T) T {
     4  	if condition {
     5  		return trueVal
     6  	} else {
     7  		return falseVal
     8  	}
     9  }