Open mnazarani opened 8 years ago
Hey @mnazarani, are you able to post your code here so I can check it out for you? Cheers
I am getting the same error in chapter 7. Running the code from 7-3 of your repo gives me:
./main.go:69: cannot use func literal (type func(http.ResponseWriter, *http.Request)) as type http.Handler in assignment: func(http.ResponseWriter, *http.Request) does not implement http.Handler (missing ServeHTTP method)
I think from following the book I arrived at
func NewRouter() *httprouter.Router { router := httprouter.New() return router }
which does compile but gives the 404s mentioned above.
Finaslly had more time to track this down - the issue is with vendoring - if you use godeps (as stated in the book) then it works. You may want to add a readme stating as much.
Good news @dmikalova. Sorry I missed your previous comment!
Just checking, when you say adding a readme, you mean to this repo?
Yeah, to the top level just so new readers don't end up as stupid as me :)
:+1:
Any path added to secureRouter returns 404 - page not found error.