{"action":"opened","issue":{"url":"https://api.github.com/repos/kataras/iris/issues/483","repository_url":"https://api.github.com/repos/kataras/iris","labels_url":"https://api.github.com/repos/kataras/iris/issues/483/labels{/name}","comments_url":"https://api.github.com/repos/kataras/iris/issues/483/comments","events_url":"https://api.github.com/repos/kataras/iris/issues/483/events","html_url":"https://github.com/kataras/iris/issues/483","id":183220863,"number":483,"title":"named parameter using API router","user":{"login":"viniciuschiele","id":392495,"avatar_url":"https://avatars.githubusercontent.com/u/392495?v=3","gravatar_id":"","url":"https://api.github.com/users/viniciuschiele","html_url":"https://github.com/viniciuschiele","followers_url":"https://api.github.com/users/viniciuschiele/followers","following_url":"https://api.github.com/users/viniciuschiele/following{/other_user}","gists_url":"https://api.github.com/users/viniciuschiele/gists{/gist_id}","starred_url":"https://api.github.com/users/viniciuschiele/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viniciuschiele/subscriptions","organizations_url":"https://api.github.com/users/viniciuschiele/orgs","repos_url":"https://api.github.com/users/viniciuschiele/repos","events_url":"https://api.github.com/users/viniciuschiele/events{/privacy}","received_events_url":"https://api.github.com/users/viniciuschiele/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-15T17:08:33Z","updated_at":"2016-10-15T17:08:33Z","closed_at":null,"body":"Hi,\r\n\r\nShouldn't the code below works?\r\n\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"fmt\"\r\n\r\n\t\"github.com/kataras/iris\"\r\n)\r\n\r\ntype DialogController struct {\r\n\t*iris.Context\r\n}\r\n\r\nfunc (c DialogController) GetBy(dialogID string) {\r\n\ttitleID := c.Param(\"param1\")\r\n\r\n\tfmt.Println(titleID)\r\n\tfmt.Println(dialogID)\r\n\r\n\tc.SetStatusCode(iris.StatusOK)\r\n}\r\n\r\nfunc main() {\r\n\tiris.API(\"/v1/titles/:param1/dialogs\", DialogController{})\r\n\r\n\tiris.Listen(\":8080\")\r\n}\r\n```\r\n\r\ncurl -X GET http://localhost:8080/v1/titles/123456/dialogs/1234\r\n\r\nI get this exception:\r\n\r\n```\r\npanic: runtime error: index out of range                                                                                        \r\n                                                                                                                                \r\ngoroutine 9 [running]:                                                                                                          \r\npanic(0x833720, 0xc82000a090)                                                                                                   \r\n        /usr/local/Cellar/go/1.6.2/libexec/src/runtime/panic.go:481 +0x3e6                                                      \r\ngithub.com/kataras/iris.(*muxAPI).API.func2.1(0xc820019860)                                                                     \r\n        /Users/vinicius/Projects/go/src/github.com/kataras/iris/iris.go:1458 +0x4da                                             \r\ngithub.com/kataras/iris.HandlerFunc.Serve(0xc82023e140, 0xc820019860)                                                           \r\n        /Users/vinicius/Projects/go/src/github.com/kataras/iris/http.go:253 +0x26                                               \r\ngithub.com/kataras/iris.(*Context).Do(0xc820019860)                                                                             \r\n        /Users/vinicius/Projects/go/src/github.com/kataras/iris/context.go:114 +0x5d                                            \r\ngithub.com/kataras/iris.(*serveMux).BuildHandler.func1(0xc820019860)                                                            \r\n        /Users/vinicius/Projects/go/src/github.com/kataras/iris/http.go:1178 +0x5cc                                             \r\ngithub.com/kataras/iris.(*Framework).Build.func1.1(0xc820210480)                                                                \r\n        /Users/vinicius/Projects/go/src/github.com/kataras/iris/iris.go:368 +0x50                                               \r\ngithub.com/valyala/fasthttp.(*Server).serveConn(0xc820256000, 0x1858bf8, 0xc82002a0f8, 0x0, 0x0)                                \r\n        /Users/vinicius/Projects/go/src/github.com/valyala/fasthttp/server.go:1528 +0x9c1                                       \r\ngithub.com/valyala/fasthttp.(*Server).(github.com/valyala/fasthttp.serveConn)-fm(0x1858bf8, 0xc82002a0f8, 0x0, 0x0)             \r\n        /Users/vinicius/Projects/go/src/github.com/valyala/fasthttp/server.go:1245 +0x42                                        \r\ngithub.com/valyala/fasthttp.(*workerPool).workerFunc(0xc820244080, 0xc82021a780)                                                \r\n        /Users/vinicius/Projects/go/src/github.com/valyala/fasthttp/workerpool.go:210 +0x126                                    \r\ngithub.com/valyala/fasthttp.(*workerPool).getCh.func1(0xc820244080, 0xc82021a780, 0x6a0000, 0xc82021a780)                       \r\n        /Users/vinicius/Projects/go/src/github.com/valyala/fasthttp/workerpool.go:182 +0x2b                                     \r\ncreated by github.com/valyala/fasthttp.(*workerPool).getCh                                                                      \r\n        /Users/vinicius/Projects/go/src/github.com/valyala/fasthttp/workerpool.go:184 +0x1e9                                    \r\nexit status 2\r\n```\r\n- Version : **4.6.0**\r\n- Operating System: macOS Sierra"}}
{"actor":{"display_login":"viniciuschiele"}}