以下のように、ルーティング設定すると、
controller.Router.GET("/shops/:shop_id", controller.getShop) controller.Router.GET("/shops/new", controller.newShop)
以下のエラーが発生する。
panic: wildcard route ':shop_id' conflicts with existing children in path '/shops/:shop_id'
github.com/gin-gonic/gin/issues/388
に同じハマり方してる人がいる。
直す方法は不明。
これだと、Railsみたいなルーティングができないね。
おそらくginというよりHttpRouter
のバグか。
non-wildcard and wildcard router conflict, why? · Issue #210 · julienschmidt/httprouter · GitHub
gin/tree.go
のaddRoute
を直したい。