10 lines
150 B
Go
10 lines
150 B
Go
|
package utils
|
||
|
|
||
|
func If(condition bool, trueVal, falseVal interface{}) interface{} {
|
||
|
if condition {
|
||
|
return trueVal
|
||
|
} else {
|
||
|
return falseVal
|
||
|
}
|
||
|
}
|