标签:go 服务端
packagemain
import"net/http"
funcSayHello(whttp.ResponseWriter,r*http.Request){
w.Write([]byte("hello"))
}
funcmain(){
http.HandleFunc("/hello",SayHello())
http.ListenAndServe(":1234",nil)
}
listenAndServer进行端口的监听
handlefunc进行注册路径的处理函数
处理函数为sayhello
本文出自 “东神要一打五” 博客,谢绝转载!
标签:go 服务端
原文地址:http://gdutccd.blog.51cto.com/9271664/1742494