{"rsdb":{"rid":"241292","subhead":"","postdate":"0","aid":"166145","fid":"78","uid":"1","topic":"1","content":"
\n

\u6700\u8fd1\u5f00\u59cb\u63a5\u6536\u4e00\u4e2a\u65b0\u9879\u76ee\uff0c\u662f\u4f7f\u7528Golang\u5199\u7684\uff0c\u9700\u8981\u91cd\u65b0\u6361\u8d77Golang\u6765\uff0c\u4e8e\u662f\u5c31\u6709\u4e86\u8fd9\u4e2a\u7cfb\u5217\u535a\u5ba2\u3002<\/p> \n

Golang\u7684\u73af\u5883\u914d\u7f6e\uff0c\u6211\u5c31\u4e0d\u8bf4\u4e86\uff0c\u8ba9\u6211\u4eec\u76f4\u63a5\u5f00\u59cb\u3002<\/p> \n

Golang\u5b98\u7f51\uff1ahttps:\/\/golang<\/a>.org<\/a>
Golang\u6807\u51c6\u5e93\u6587\u6863\uff1a
https:\/\/golang<\/a>.org\/pkg<\/a>
Golang\u4e2d\u6587\u6807\u51c6\u5e93\u6587\u6863\uff1a
https:\/\/studygolang.com\/pkgdoc<\/a><\/p> \n

\u4e0b\u9762\u6211\u4eec\u5148\u6765\u6267\u884c\u4e00\u4e2aHello World\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p> \n

package main\n\nimport "fmt"\n\nfunc main() {\n    fmt.Println("Hello World")\n}<\/code><\/pre> \n 

\u7f16\u8bd1\u6267\u884c\uff0c\u8f93\u51fa<\/p> \n

Hello World<\/code><\/pre> \n 

\u6211\u4eec\u518d\u6765\u4f7f\u7528go\u542f\u52a8\u4e00\u4e2aweb server\uff0c\u5927\u5bb6\u901a\u8fc7\u6d4f\u89c8\u5668\u53ef\u4ee5\u8bbf\u95ee\u5230\u76f8\u5e94\u7684\u9875\u9762<\/p> \n

\u6211\u4eec\u5148\u6765\u5b9e\u73b0\u6700\u7b80\u5355\u7684\u9875\u9762\uff0c\u5c55\u793aHello World\u7684\u6587\u5b57\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p> \n

package main\n\nimport (\n    "net\/http"\n    "log"\n    "fmt"\n)\n\nfunc hello(w http.ResponseWriter, r *http.Request) {\n    fmt.Fprintln(w, "Hello World!") \/\/ \u5199\u5165\u5230w\u7684\u662f\u8f93\u51fa\u5230\u5ba2\u6237\u7aef\u7684\n}\n\nfunc main() {\n    http.HandleFunc("\/", hello) \/\/ \u8bbe\u7f6e\u8bbf\u95ee\u7684\u8def\u7531\n    err := http.ListenAndServe(":9090", nil) \/\/ \u8bbe\u7f6e\u76d1\u542c\u7684\u7aef\u53e3\n    if err != nil {\n        log.Fatal("ListenAndServe: ", err)\n    }\n}<\/code><\/pre> \n 

\u8bbf\u95eeURL http:\/\/localhost:9090<\/a> \uff0c\u5c31\u53ef\u4ee5\u770b\u5230\u5982\u4e0b\u9875\u9762<\/p> \n

<\/p> \n

\u8fd9\u6837\u6211\u4eec\u5c31\u5b8c\u6210\u4e86go\u6700\u57fa\u7840\u7684\u4e24\u4e2a\u793a\u4f8b\u3002<\/p> \n

\u8fd9\u4e2a\u7cfb\u5217\u4e0d\u6253\u7b97\u8bb2go\u7684\u57fa\u672c\u8bed\u6cd5\uff0c\u60f3\u8981\u5b66\u4e60\u7684\u8bdd\uff0c\u53ef\u4ee5\u67e5\u770bX\u5206\u949f\u901f\u6210Golang<\/a><\/p> \n<\/div>","orderid":"0","title":"Golang\u5b66\u4e60--\u5f00\u7bc7","smalltitle":"","mid":"0","fname":"GO","special_id":"0","bak_id":"0","info":"0","hits":"216","pages":"1","comments":"0","posttime":"2017-11-17 08:28:23","list":"1510878503","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"http:\/\/images2017.cnblogs.com\/blog\/587057\/201711\/587057-20171113165301687-1544241763.png","ispic":"1","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"Golang<\/A> \u5b66\u4e60<\/A> --\u5f00\u7bc7<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"113.87.123.115","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"Golang\u5b66\u4e60--\u5f00\u7bc7","lastview":"1713035429","digg_num":"0","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}