1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-21 20:07:04 +00:00

add int8, int16, int32, uint, uint16 and uint32 default-builtn parameter types and macros - no doc update - no live tests yet - time for sleep

Former-commit-id: 4a27265a9f1368c4bbecd852691155e56c875673
This commit is contained in:
Gerasimos (Makis) Maropoulos
2018-09-27 06:20:03 +03:00
parent d6d27b2605
commit f05ee872d0
4 changed files with 222 additions and 17 deletions

View File

@@ -154,6 +154,10 @@ func convertBuilderFunc(fn interface{}) ParamFuncBuilder {
v, err := strconv.ParseInt(arg, 10, 64)
panicIfErr(err)
val = v
case reflect.Uint:
v, err := strconv.ParseUint(arg, 10, strconv.IntSize)
panicIfErr(err)
val = uint(v)
case reflect.Uint8:
v, err := strconv.ParseUint(arg, 10, 8)
panicIfErr(err)
@@ -245,7 +249,7 @@ type (
// and returns a function as value, its job
// is to make the macros to be registered
// by user at the most generic possible way.
ParamFuncBuilder func([]string) reflect.Value // the func
ParamFuncBuilder func([]string) reflect.Value // the func(<T>) bool
// ParamFunc represents the parsed
// parameter function, it holds