This commit is contained in:
aozhiwei 2024-04-20 15:57:18 +08:00
parent fc08e4f8c5
commit 75b0c72d72

View File

@ -199,3 +199,15 @@ func DuckToSimple[T string | int | int32 | int64 | float32 | float64](
}
return true
}
func ToBool[T int32 | int64 ](value T) bool {
return value != 0
}
func BoolToInt32(value bool) int32 {
if value {
return 1
} else {
return 0
}
}