package main import "net/http" func f1(a http.ResponseWriter, b *http.Request) { str := "<H1>Hello Dzw!</H1>" a.Write([]byte(str)) } func main() { http.HandleFunc("/dzw/Test01", f1) http.ListenAndServe("127.0.0.1:9090", nil) }
结果:
参考:https://www.bilibili.com/video/BV1fz4y1m7Pm?p=120