1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00
This commit is contained in:
2022-03-29 10:39:39 +08:00
parent 7eb426e5b2
commit 1c4f84d765
2 changed files with 18 additions and 0 deletions

9
expr/expr.go Normal file
View File

@ -0,0 +1,9 @@
package expr
// 如为真返回参数一,否则返回参数二
func If[T any](e bool, v1, v2 T) T {
if e {
return v1
}
return v2
}