v0.0.21
This commit is contained in:
parent
06a37f37b7
commit
9d9a6f1c6e
@ -7,3 +7,11 @@ func FormatBool(v bool, strTrue string, strFalse string) string {
|
||||
return strFalse
|
||||
}
|
||||
}
|
||||
|
||||
func Conditional[T any](v bool, resTrue T, resFalse T) T {
|
||||
if v {
|
||||
return resTrue
|
||||
} else {
|
||||
return resFalse
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user