init code
This commit is contained in:
10
internal/utils/opx/ternary.go
Normal file
10
internal/utils/opx/ternary.go
Normal file
@@ -0,0 +1,10 @@
|
||||
package opx
|
||||
|
||||
// Ite If-then-else
|
||||
func Ite[T any](condition bool, trueValue T, falseValue T) T {
|
||||
if condition {
|
||||
return trueValue
|
||||
} else {
|
||||
return falseValue
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user