Fix uint out of value parsing for > 4 GiB traffic usage

This commit is contained in:
games647
2017-10-03 11:43:22 +02:00
committed by Huin
parent 5b7801abd8
commit b3887248e5
3 changed files with 35 additions and 4 deletions

View File

@ -47,6 +47,15 @@ func UnmarshalUi4(s string) (uint32, error) {
return uint32(v), err
}
func MarshalUi8(v uint64) (string, error) {
return strconv.FormatUint(v, 10), nil
}
func UnmarshalUi8(s string) (uint64, error) {
v, err := strconv.ParseUint(s, 10, 64)
return uint64(v), err
}
func MarshalI1(v int8) (string, error) {
return strconv.FormatInt(int64(v), 10), nil
}