// webserver that says hello package main import ( "fmt" "net/http" ) func main() { http.HandleFunc("/", handler) http.ListenAndServe(":8080", nil) } func handler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hello, world!") } // Output: // $ go run test.go // Hello, world! // $