I'm trying to get my web server to accept different socket calls in one function. My code looks like this:
Go:
func handler(w io.Writer, r *io.ReadCloser) {
//do something
}
func main() {
http.HandleFunc("/", handler)
http.ListenAndServe(":3000", nil)
}
I get the error:
cannot use handler (type func(io.Writer, *io.ReadCloser)) as type func(http.ResponseWriter, *http.Request) in argument to http.HandleFunc
How do I implement this?