mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-26 19:43:48 +00:00
21 lines
316 B
Go
21 lines
316 B
Go
|
package server
|
||
|
|
||
|
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
|
||
|
}
|