I was trying to build basic web API using gorilla mux in Go. Here is my code. Please help me understand how some interfaces are working here.
func main() {
r := mux.NewRouter()
r.Handle("/", http.FileServer(http.Dir("./views/")))
r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("./static/"))))
r.Handle("/status", myHandler).Methods("GET")
http.ListenAndServe(":8080", r)
}
func myHandler(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
} ```
error :- `cannot use myHandler (value of type func(w http.ResponseWriter, r *http.Request)) as http.Handler value in argument to r.Handle: missing method ServeHTTP `