I want to add a convenience util method on to gorilla/mux
Route and Router types:
package util
import(
\"net/http\"
\"github.com/0xor1/
As the compiler mentions, you can't extend existing types in another package. You can define your own alias or sub-package as follows:
type MyRouter mux.Router
func (m *MyRouter) F() { ... }
or by embedding the original router:
type MyRouter struct {
*mux.Router
}
func (m *MyRouter) F() { ... }
...
r := &MyRouter{router}
r.F()