package main
import (
"io"
"log"
"net/http"
)
func main() {
http.HandleFunc("/hello", func(w http.ResponseWriter, req *http.Request) {
io.WriteString(w, "hello, world!\n")})
err := http.ListenAndServe(":9091", nil)
if err != nil {
log.Fatal("ListenAndServe: ", err)
}
}
Go语言http
最新推荐文章于 2024-09-01 17:07:46 发布