10 lines
180 B
Go
10 lines
180 B
Go
package util
|
|
|
|
// IF 三元表达式
|
|
func IF(condition bool, trueValue interface{}, falseValue interface{}) interface{} {
|
|
if condition {
|
|
return trueValue
|
|
}
|
|
return falseValue
|
|
}
|