ServeHTTP cannot take a pointer receiver

This commit is contained in:
2020-12-13 23:26:09 -08:00
parent ee0bb08b57
commit 0a6b9b2d0a
2 changed files with 2 additions and 2 deletions

2
go.mod
View File

@ -1,3 +1,3 @@
module github.com/jr-dev-league/go-router module github.com/jr-dev-league/go-router
go 1.15 go 1.15

View File

@ -143,7 +143,7 @@ func (r *Router) Handler(req *http.Request) (h http.Handler, pattern string) {
// //
// In the case of this router, all it needs to do is lookup the Handler that has been saved at a given // In the case of this router, all it needs to do is lookup the Handler that has been saved at a given
// path and then call its ServeHTTP. // path and then call its ServeHTTP.
func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) { func (r Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
method := req.Method method := req.Method
path := req.URL.Path path := req.URL.Path
var handler http.Handler var handler http.Handler