Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
package main
import (
var listenOn = ""
func helloHandler(w http.ResponseWriter, r *http.Request) {
log.Printf("%#v", r)
fmt.Fprint(w, "hello world")
func init() {
flag.StringVar(&listenOn, "listen", listenOn, "The address to listen on for web requests")
func main() {
http.HandleFunc("/hello", helloHandler)
log.Fatal(http.ListenAndServe(listenOn, nil))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.