ServeHTTP cannot take a pointer receiver
This commit is contained in:
2
go.mod
2
go.mod
@ -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
|
||||||
|
@ -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
|
||||||
|
Reference in New Issue
Block a user