fix router

This commit is contained in:
Nazar Kanaev
2021-03-16 20:48:00 +00:00
parent f214c3166b
commit 80482e70a8
4 changed files with 29 additions and 24 deletions

View File

@@ -1,6 +1,8 @@
package router
import (
"encoding/json"
"log"
"net/http"
)
@@ -16,7 +18,7 @@ type Context struct {
func (c *Context) Next() {
c.index++
c.handlers[c.index](c)
c.chain[c.index](c)
}
func (c *Context) JSON(status int, data interface{}) {