From 7b94a4666ce1f704fcdf59e3452345a261ab673a Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Fri, 24 Aug 2018 14:43:19 +0300 Subject: [PATCH] format the prev Former-commit-id: 4d203295b1daa1091a45de8ce683af0e6b47365b --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eb800cee..e865eb43 100644 --- a/README.md +++ b/README.md @@ -190,7 +190,7 @@ latLonRegex, _ := regexp.Compile(latLonExpr) // MatchString is a type of func(string) bool, so we use it as it is. app.Macros().String.RegisterFunc("coordinate", latLonRegex.MatchString) -app.Get("/coordinates/{lat:string coordinate() else 400}/{lon:string coordinate() else 400}", func(ctx iris.Context) { +app.Get("/coordinates/{lat:string coordinate()}/{lon:string coordinate()}", func(ctx iris.Context) { ctx.Writef("Lat: %s | Lon: %s", ctx.Params().Get("lat"), ctx.Params().Get("lon")) }) ``` @@ -205,7 +205,7 @@ app.Macros().String.RegisterFunc("range", func(minLength, maxLength int) func(st } }) -app.Get("/limitchar/{name:string range(1,200)}", func(ctx iris.Context) { +app.Get("/limitchar/{name:string range(1,200) else 400}", func(ctx iris.Context) { name := ctx.Params().Get("name") ctx.Writef(`Hello %s | the name should be between 1 and 200 characters length otherwise this handler will not be executed`, name)