( "io" "log" "net/http" ) func main() { helloHandler := func(w http.ResponseWriter, req *http.Request) { io.WriteString(w, "Hello, world!\n") } http.HandleFunc("/", helloHandler) log.Println("Listening...") http.ListenAndServe(":3000", nil) // open 3000 port }