import (
"fmt"
"net/http"
)
func sayhello(w http.ResponseWriter, r *http.Request) {
_, _ = fmt.Fprintf(w, "<h1>hello golang!<h1>")
}
func main() {
http.HandleFunc("/hello", sayhello)
err := http.ListenAndServe(":9090", nil)
if err != nil {
fmt.Printf("http serve failed,err:%v\n", err)
return
}
}
Hello Golang
最新推荐文章于 2024-07-14 22:33:03 发布