2022-07-21 13:21:44 +00:00
|
|
|
package rpcsrv
|
2021-04-19 07:48:35 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
"errors"
|
|
|
|
"math"
|
|
|
|
)
|
|
|
|
|
|
|
|
func checkUint32(i int) error {
|
|
|
|
if i < 0 || i > math.MaxUint32 {
|
|
|
|
return errors.New("value should fit uint32")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func checkInt32(i int) error {
|
|
|
|
if i < math.MinInt32 || i > math.MaxInt32 {
|
|
|
|
return errors.New("value should fit int32")
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|