1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-21 11:57:02 +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

@@ -83,7 +83,6 @@ func convertTmplToHandler(tmpl *macro.Template) context.Handler {
return func(tmpl macro.Template) context.Handler {
return func(ctx context.Context) {
for _, p := range tmpl.Params {
paramValue := ctx.Params().Get(p.Name)
if p.TypeEvaluator == nil {
// allow.
ctx.Next()
@@ -91,7 +90,7 @@ func convertTmplToHandler(tmpl *macro.Template) context.Handler {
}
// first, check for type evaluator.
newValue, passed := p.TypeEvaluator(paramValue)
newValue, passed := p.TypeEvaluator(ctx.Parms().Get(p.Name))
if !passed {
ctx.StatusCode(p.ErrCode)
ctx.StopExecution()