Как реализована следующая функция?
func handle(pattern string, handler interface{}) {
// ... what goes here? ...
http.Handle(pattern, ?)
}
handle("/foo", func(w http.ResponseWriter, r http.Request) { io.WriteString(w, "foo") }
handle("/bar", BarHandler{})
handle ()) передается либо функция, которая соответствует типу http.HandlerFunc, либо типу который реализует интерфейс http.Handler.