1
This commit is contained in:
parent
fc08e4f8c5
commit
75b0c72d72
12
convert.go
12
convert.go
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user