{"id":2703,"date":"2015-08-11T17:08:43","date_gmt":"2015-08-11T09:08:43","guid":{"rendered":"http:\/\/ellery.no-ip.info\/wp\/thinkingmore\/?p=2703"},"modified":"2015-08-15T01:52:57","modified_gmt":"2015-08-14T17:52:57","slug":"golang-%e8%b5%b7%e6%89%8b","status":"publish","type":"post","link":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/2015\/08\/golang-%e8%b5%b7%e6%89%8b\/","title":{"rendered":"golang \u8d77\u624b"},"content":{"rendered":"<p>\u74b0\u5883\u662f Ubuntu 14.04 trusy\uff0c14.04 \u9810\u8f09\u7684 go \u7248\u672c\u662f 1.2.1 \u3002<\/p>\n<p>\u5148\u5b89\u88dd golang \uff1asudo apt-get install golang golang-go golang-go.tools \uff0c\u7136\u5f8c\u8a2d\u5b9a\u74b0\u5883\u8b8a\u6578\uff0c\u770b\u662f\u7528 bash \u6216 zsh\uff0cbash \u5c31\u662f\u6539 $HOME\/.bashrc\uff0czsh \u5c31\u662f\u6539 $HOME\/.zshrc\uff0c\u52a0\u5165\uff1a<\/p>\n<pre>export GOROOT=$(go env GOROOT)\nexport GOPATH=$HOME\/.go\nexport PATH=$PATH:$GOROOT\/bin:$GOPATH\/bin\n<\/pre>\n<p>\u7136\u5f8c mkdir -p $HOME\/.go \uff0c$GOPATH \u9019\u8def\u5f91\u88e1\uff0c\u653e\u7684\u662f go get \u6240\u53d6\u5f97\u7684\u539f\u59cb\u78bc\u3002<\/p>\n<p>\u63a5\u8457\u5c31\u53ef\u4ee5\u7167 <a href=\"http:\/\/www.philo.top\/2015\/02\/06\/golang-%E7%8E%AF%E5%A2%83%E9%85%8D%E7%BD%AE%E5%BB%BA%E8%AE%AE\/\">golang \u73af\u5883\u914d\u7f6e\u5efa\u8bae<\/a> \u88cf\u9762\u7684\u5efa\u8b70\u4f86\u5b89\u88dd\u5de5\u5177\uff0c\u88cf\u9762\u7684 oracle \u53ef\u4ee5\u8df3\u904e\uff0c\u9019\u5df2\u7d93\u5305\u5728 golang-go.tools \u88e1\u3002\u53e6\u5916\u9019\u7bc7\u88e1\u7684\u7de8\u8f2f\u5668\u662f\u4ecb\u7d39\u7528 Github \u7684 ATOM\uff0c\u6240\u4ee5\u8a72\u627e\u6642\u9593\u4f86\u627e\u4e00\u4e0b vim \u7684\u597d\u7528 plugin \u4f86\u7528\u3002<\/p>\n<p>\u8981\u5b89\u88dd\u6bd4\u8f03\u65b0\u7248\u672c\u7684 golang \uff0c\u9664\u4e86\u53ef\u4ee5\u627e ppa \u4e4b\u5916\uff0c\u4e5f\u53ef\u4ee5\u7528 govm \u6216 gvm \u4f86\u5b89\u88dd\uff1a<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/moovweb\/gvm\">moovweb\/gvm<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/MakeNowJust\/govm\">MakeNowJust\/govm<\/a><\/li>\n<\/ul>\n<p>govm \u770b\u8d77\u4f86\u986f\u7136\u662f\u5c0f\u5f88\u591a\uff0cgvm \u5728\u7db2\u8def\u4e0a\u7684<a href=\"http:\/\/chrisyuan-engineering.logdown.com\/posts\/193355-gvm-install-golang\" target=\"_blank\">\u4ecb\u7d39\u6587<\/a>\u6bd4\u8f03\u591a\uff0c\u81ea\u5df1\u76ee\u524d\u662f\u9084\u6c92\u8a66\u904e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u74b0\u5883\u662f Ubuntu 14.04 trusy\uff0c14.04 \u9810\u8f09\u7684 go \u7248\u672c\u662f 1.2.1 \u3002 \u5148\u5b89\u88dd golang \uff1asudo apt-get install golang golang-go golang-go.tools \uff0c\u7136\u5f8c\u8a2d\u5b9a\u74b0\u5883\u8b8a\u6578\uff0c\u770b\u662f\u7528 bash \u6216 zsh\uff0cbash \u5c31\u662f\u6539 $HOME\/.bashrc\uff0czsh \u5c31\u662f\u6539 $HOME\/.zshrc\uff0c\u52a0\u5165\uff1a export GOROOT=$(go env GOROOT) export GOPATH=$HOME\/.go export PATH=$PATH:$GOROOT\/bin:$GOPATH\/bin \u7136\u5f8c mkdir -p $HOME\/.go \uff0c$GOPATH \u9019\u8def\u5f91\u88e1\uff0c\u653e\u7684\u662f go get \u6240\u53d6\u5f97\u7684\u539f\u59cb\u78bc\u3002 \u63a5\u8457\u5c31\u53ef\u4ee5\u7167 golang \u73af\u5883\u914d\u7f6e\u5efa\u8bae \u88cf\u9762\u7684\u5efa\u8b70\u4f86\u5b89\u88dd\u5de5\u5177\uff0c\u88cf\u9762\u7684 oracle \u53ef\u4ee5\u8df3\u904e\uff0c\u9019\u5df2\u7d93\u5305\u5728 golang-go.tools \u88e1\u3002\u53e6\u5916\u9019\u7bc7\u88e1\u7684\u7de8\u8f2f\u5668\u662f\u4ecb\u7d39\u7528 Github \u7684 ATOM\uff0c\u6240\u4ee5\u8a72\u627e\u6642\u9593\u4f86\u627e\u4e00\u4e0b vim \u7684\u597d\u7528 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/2015\/08\/golang-%e8%b5%b7%e6%89%8b\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;golang \u8d77\u624b&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[5],"tags":[98],"class_list":["post-2703","post","type-post","status-publish","format-standard","hentry","category-idea","tag-golang"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":false,"jetpack_shortlink":"https:\/\/wp.me\/p2MOxp-HB","_links":{"self":[{"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/posts\/2703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/comments?post=2703"}],"version-history":[{"count":4,"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/posts\/2703\/revisions"}],"predecessor-version":[{"id":2714,"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/posts\/2703\/revisions\/2714"}],"wp:attachment":[{"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/media?parent=2703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/categories?post=2703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ellery.no-ip.info\/wp\/thinkingmore\/wp-json\/wp\/v2\/tags?post=2703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}