Skip to content

Instantly share code, notes, and snippets.

@sagar290
Created February 24, 2021 19:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sagar290/11bcd1827a234c75e11d35ee2dc501fb to your computer and use it in GitHub Desktop.
Save sagar290/11bcd1827a234c75e11d35ee2dc501fb to your computer and use it in GitHub Desktop.
package main
import (
"io"
"log"
"net/http"
)
func d(res http.ResponseWriter, req *http.Request) {
io.WriteString(res, "dog dog dog")
}
func c(res http.ResponseWriter, req *http.Request) {
io.WriteString(res, "dog dog dog")
}
func main() {
http.HandleFunc("/dog/", c)
http.HandleFunc("/cat/", c)
if err := http.ListenAndServe(":8088", nil); err != nil {
log.Fatal("ListenAndServe:", err)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment