From c262c5076a2d128e70bda4fbf5996ebc4ae23778 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Tue, 30 Oct 2018 00:57:08 +0200 Subject: [PATCH] fix https://github.com/kataras/iris/issues/1118 Former-commit-id: b3334c1351bfa1c9be431a453a6b9439b3aac003 --- core/memstore/memstore.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/memstore/memstore.go b/core/memstore/memstore.go index 001762e0..af933c07 100644 --- a/core/memstore/memstore.go +++ b/core/memstore/memstore.go @@ -267,7 +267,7 @@ func (e Entry) UintDefault(def uint) (uint, error) { } x64 := strconv.IntSize == 64 - var maxValue uint = math.MaxUint32 + var maxValue uint64 = math.MaxUint32 if x64 { maxValue = math.MaxUint64 } @@ -436,7 +436,9 @@ func (e Entry) Uint32Default(def uint32) (uint32, error) { return def, errFindParse.Format("uint32", e.Key) } return uint32(vv), nil - case int: + case int32: + return uint32(vv), nil + case int64: if vv < 0 || vv > math.MaxUint32 { return def, errFindParse.Format("uint32", e.Key) } @@ -464,11 +466,6 @@ func (e Entry) Uint64Default(def uint64) (uint64, error) { return def, errFindParse.Format("uint64", e.Key) } return uint64(val), nil - case uint: - if vv > math.MaxUint64 { - return def, errFindParse.Format("uint64", e.Key) - } - return uint64(vv), nil case uint8: return uint64(vv), nil case uint16: