diff options
| author | Eltrac <hi@guhub.cn> | 2025-12-03 15:36:29 +0800 |
|---|---|---|
| committer | Eltrac <hi@guhub.cn> | 2025-12-03 15:36:29 +0800 |
| commit | f2103d4182acde938572c16753f8752c1f811fbf (patch) | |
| tree | 9653faea7dd4e742c2d65fb7f758f3ebf9239a67 /engine.go | |
| parent | 2ac34a23542c7c66427e7ca9bd33d14ba03c0dd7 (diff) | |
refactor: use vanilla URL.Query() instead of a custom parser
Since `parser.go` only exists for splitting paths and parsing query string at
the same time, it should be removed when parsing is no longer needed. Path
splitting is done by a helper function inside `router.go`.
Diffstat (limited to 'engine.go')
| -rw-r--r-- | engine.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -33,7 +33,7 @@ func (api *Engine) DELETE(path string, h Handler) { // serve and start func (a *Engine) ServeHTTP(w http.ResponseWriter, req *http.Request) { - handler, params, query := a.router.Find(req.Method, req.URL.Path) + handler, params := a.router.Find(req.Method, req.URL.Path) if handler == nil { http.NotFound(w, req) return @@ -42,7 +42,7 @@ func (a *Engine) ServeHTTP(w http.ResponseWriter, req *http.Request) { W: w, R: req, Params: params, - Querys: query, + Querys: req.URL.Query(), }) } |
