生活随笔
收集整理的這篇文章主要介紹了
centos7下配置golang1.7.1环境(自己做测试了)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
環境(個人阿里云主機):
[plain] view plaincopy
#?hostnamectl?????Static?hostname:?iZ23nwzgx3sZ???????????Icon?name:?computer-vm?????????????Chassis:?vm??????????Machine?ID:?45461f76679f48ee96e95da6cc798cc8?????????????Boot?ID:?4022018209e04363871ed0279a30c225??????Virtualization:?xen????Operating?System:?CentOS?Linux?7?(Core)?????????CPE?OS?Name:?cpe:/o:centos:centos:7??????????????Kernel:?Linux?3.10.0-229.11.1.el7.x86_64????????Architecture:?x86-64??#?lsb_release?-a??LSB?Version:????:core-4.1-amd64:core-4.1-noarch??Distributor?ID:?CentOS??Description:????CentOS?Linux?release?7.2.1511?(Core)???Release:????????7.2.1511??Codename:???????Core??
到官方https://golang.org/dl/下載安裝包
[plain] view plaincopy
</pre><pre?name="code"?class="plain">#wget?https://storage.googleapis.com/golang/go1.7.1.linux-amd64.tar.gz????#?tar?zxvf?go1.7.1.linux-amd64.tar.gz?-C?/usr/local????新建GOPATH目錄??#?mkdir?-p?/mnt/wwwroot/gofile??#?vim?/etc/profile????export?GOROOT=/usr/local/go??export?GOBIN=$GOROOT/bin??export?PATH=$PATH:$GOBIN??export?GOPATH=/mnt/wwwroot/gofile??:wq保存????使其生效??#source?/etc/profile????查看是否配置成功??#?go?version??go?version?go1.7.1?linux/amd64????簡單測試:??#?cd?/mnt/wwwroot/gofile??#?vim?hello.go??package?main??import?"fmt"??func?main()?{??????fmt.Println("Hello,?世界")??}??#?go?run?hello.go??Hello,?世界?
來源:http://blog.csdn.net/ligaofeng/article/details/52671680
總結
以上是生活随笔為你收集整理的centos7下配置golang1.7.1环境(自己做测试了)的全部內容,希望文章能夠幫你解決所遇到的問題。
如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。