package main import ( "log" "net/http" ) func handleHttp(response http.ResponseWriter, request *http.Request) { response.Write([]byte("hello world")) } func main() { http.HandleFunc("/", handleHttp) err := http.ListenAndServe(":8080", nil) if err != nil { log.Fatal(err) } }
时间: 2024-12-14 18:13:29