Better API for RouteGroup.Handle()

This commit is contained in:
Manu Mtz-Almeida
2015-05-19 23:22:35 +02:00
parent 53329e4646
commit 022304e7d9
5 changed files with 39 additions and 35 deletions

2
gin.go
View File

@ -140,7 +140,7 @@ func (engine *Engine) rebuild405Handlers() {
engine.allNoMethod = engine.combineHandlers(engine.noMethod)
}
func (engine *Engine) handle(method, path string, handlers HandlersChain) {
func (engine *Engine) addRoute(method, path string, handlers HandlersChain) {
if path[0] != '/' {
panic("path must begin with '/'")
}