强大的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
如何为Linux安装Go语言 http://www.linuxidc.com/Linux/2015-09/123114.htm
Linux系统入门学习-在Linux中安装Go语言 http://www.linuxidc.com/Linux/2015-02/113159.htm
Ubuntu 安装Go语言包 http://www.linuxidc.com/Linux/2013-05/85171.htm
《Go语言编程》高清完整版电子书 http://www.linuxidc.com/Linux/2013-05/84709.htm
Go语言并行之美 -- 超越 “Hello World” http://www.linuxidc.com/Linux/2013-05/83697.htm
我为什么喜欢Go语言 http://www.linuxidc.com/Linux/2013-05/84060.htm
Go语言内存分配器的实现 http://www.linuxidc.com/Linux/2014-01/94766.htm
本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-02/128556.htm