Context
context内部包含了*http.Request和http.ResponseWriter
type Context struct {// 对内使用,可以用于接受http.ResponseWriter的值writermem responseWriterRequest *http.Request// http.ResponseWriter的增强版Writer ResponseWriterParams Paramshandlers HandlersChainindex int8fullPath stringengine *Engine// This mutex protect Keys mapmu sync.RWMutex// Keys is a key/value pair exclusively for the context of each request.Keys map[string]interface{}// Errors is a list of errors attached to all the handlers/middlewares who used this context.Errors errorMsgs//...}
路由
路由分组是基于Radix树,即基数树,也称压缩前缀树



r.GET("/user/:id", test)r.GET("/user/:id/page", test) // okr.GET("/user/name", test) // panic
