重构白银节点分配方式,使用手动接口精确配置节点
This commit is contained in:
@@ -25,6 +25,15 @@ func ElseTo[A any, B any](a *A, f func(A) B) *B {
|
||||
}
|
||||
}
|
||||
|
||||
// 三元表达式
|
||||
func Ternary[T any](condition bool, trueValue T, falseValue T) T {
|
||||
if condition {
|
||||
return trueValue
|
||||
} else {
|
||||
return falseValue
|
||||
}
|
||||
}
|
||||
|
||||
// ====================
|
||||
// 指针
|
||||
// ====================
|
||||
|
||||
Reference in New Issue
Block a user