mirror of
https://github.com/kataras/iris.git
synced 2025-03-15 17:36:29 +01:00
Former-commit-id: b3334c1351bfa1c9be431a453a6b9439b3aac003
This commit is contained in:
parent
be32418bc1
commit
c262c5076a
|
@ -267,7 +267,7 @@ func (e Entry) UintDefault(def uint) (uint, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
x64 := strconv.IntSize == 64
|
x64 := strconv.IntSize == 64
|
||||||
var maxValue uint = math.MaxUint32
|
var maxValue uint64 = math.MaxUint32
|
||||||
if x64 {
|
if x64 {
|
||||||
maxValue = math.MaxUint64
|
maxValue = math.MaxUint64
|
||||||
}
|
}
|
||||||
|
@ -436,7 +436,9 @@ func (e Entry) Uint32Default(def uint32) (uint32, error) {
|
||||||
return def, errFindParse.Format("uint32", e.Key)
|
return def, errFindParse.Format("uint32", e.Key)
|
||||||
}
|
}
|
||||||
return uint32(vv), nil
|
return uint32(vv), nil
|
||||||
case int:
|
case int32:
|
||||||
|
return uint32(vv), nil
|
||||||
|
case int64:
|
||||||
if vv < 0 || vv > math.MaxUint32 {
|
if vv < 0 || vv > math.MaxUint32 {
|
||||||
return def, errFindParse.Format("uint32", e.Key)
|
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 def, errFindParse.Format("uint64", e.Key)
|
||||||
}
|
}
|
||||||
return uint64(val), nil
|
return uint64(val), nil
|
||||||
case uint:
|
|
||||||
if vv > math.MaxUint64 {
|
|
||||||
return def, errFindParse.Format("uint64", e.Key)
|
|
||||||
}
|
|
||||||
return uint64(vv), nil
|
|
||||||
case uint8:
|
case uint8:
|
||||||
return uint64(vv), nil
|
return uint64(vv), nil
|
||||||
case uint16:
|
case uint16:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user