From 8b4167c2ab73e0da7421e5a8cb79a6125f5c7a46 Mon Sep 17 00:00:00 2001 From: YuShuaiLiu Date: Fri, 14 Sep 2018 15:06:46 +0800 Subject: [PATCH 1/2] fix README Former-commit-id: a7c3c6555d4a378d1c4e2647bd1f08566b5a2b37 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a7643963..a0f91679 100644 --- a/README.md +++ b/README.md @@ -890,7 +890,7 @@ func main() { ### Testing -Iris offers an incredible support for the [httpexpect](github.com/iris-contrib/httpexpect), a Testing Framework for web applications. However, you are able to use the standard Go's `net/http/httptest` package as well but in this example we will use the `kataras/iris/httptest`. +Iris offers an incredible support for the [httpexpect](https://github.com/iris-contrib/httpexpect), a Testing Framework for web applications. However, you are able to use the standard Go's `net/http/httptest` package as well but in this example we will use the `kataras/iris/httptest`. ```go package main From f4e2742dc7ad3f4fd3322f8b83b02e8ba1af3fc2 Mon Sep 17 00:00:00 2001 From: liguoqinjim Date: Sun, 16 Sep 2018 21:52:11 +0800 Subject: [PATCH 2/2] update README.md example (#1084) * update README.md example * update README.md example Former-commit-id: 5eb484d2204e839e5408d3b8cf98fa0981d4727a --- README.md | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index a7643963..ee65d04e 100644 --- a/README.md +++ b/README.md @@ -212,31 +212,32 @@ app.Get("/static_validation/{name:string has([kataras,gerasimos,maropoulos]}", f ```go func main() { - app := iris.Default() + app := iris.Default() - // This handler will match /user/john but will not match neither /user/ or /user. - app.Get("/user/{name}", func(ctx iris.Context) { - name := ctx.Params().Get("name") - ctx.Writef("Hello %s", name) - }) + // This handler will match /user/john but will not match neither /user/ or /user. + app.Get("/user/{name}", func(ctx iris.Context) { + name := ctx.Params().Get("name") + ctx.Writef("Hello %s", name) + }) - // This handler will match /users/42 - // but will not match - // neither /users or /users/. - app.Get("/users/{id:int64}", func(ctx iris.Context) { - id, _ := ctx.Params().GetUint64("id") - ctx.Writef("User with ID: %d", id) - }) + // This handler will match /users/42 + // but will not match + // neither /users or /users/. + app.Get("/users/{id:long}", func(ctx iris.Context) { + id, _ := ctx.Params().GetInt64("id") + ctx.Writef("User with ID: %d", id) + }) - // However, this one will match /user/john/ and also /user/john/send. - app.Post("/user/{name:string}/{action:path}", func(ctx iris.Context) { - name := ctx.Params().Get("name") - action := ctx.Params().Get("action") - message := name + " is " + action - ctx.WriteString(message) - }) + // This handler will match /user/john/send + // but will not match /user/john/ + app.Post("/user/{name:string}/{action:path}", func(ctx iris.Context) { + name := ctx.Params().Get("name") + action := ctx.Params().Get("action") + message := name + " is " + action + ctx.WriteString(message) + }) - app.Run(iris.Addr(":8080")) + app.Run(iris.Addr(":8080")) } ```