【Get 以太坊技能】CentOS 7 安装 go
生活随笔
收集整理的這篇文章主要介紹了
【Get 以太坊技能】CentOS 7 安装 go
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
前言
- CentOS Linux release 7.4.1708 (Core)
- go1.13.4.linux-amd64.tar.gz
- https://golang.google.cn
Step1:下載&解壓
下載地址:https://golang.google.cn/dl/
根據(jù)需要,選擇對應(yīng)的版本進行下載。本文使用go1.13.4.linux-amd64。
使用wget下載:
驗證下載文件的完整性:
shell> sha256sum go1.13.4.linux-amd64.tar.gz 692d17071736f74be04a72a06dab9cac1cd759377bd85316e52b2227604c004c go1.13.4.linux-amd64.tar.gz解壓:
shell> tar -zxvf go1.13.4.linux-amd64.tar.gz ... go/test/typeswitch.go go/test/typeswitch1.go go/test/typeswitch2.go go/test/typeswitch3.go go/test/uintptrescapes.dir/ go/test/uintptrescapes.dir/a.go go/test/uintptrescapes.dir/main.go go/test/uintptrescapes.go go/test/uintptrescapes2.go go/test/undef.go go/test/utf.go go/test/varerr.go go/test/varinit.go go/test/writebarrier.go go/test/zerodivide.goStep2:配置GOPATH
修改profile:
shell> cp /etc/profile /etc/profile_bak_`date +%Y%m%d` shell> echo "# config go path" >> /etc/profile shell> echo "export GOPATH=/data/sde/go/go" >> /etc/profile shell> echo "export export PATH=\$PATH:\$GOPATH/bin" >> /etc/profile shell> echo "" >> /etc/profile確認修改后的profile是否正確:
shell> cat /etc/profile ... # config go path export GOPATH=/data/sde/go/go export export PATH=$PATH:$GOPATH/bin讓修改后的profile生效:
shell> source /etc/profileStep3:驗證
查看版本
shell> go version go version go1.13.4 linux/amd64查看環(huán)境變量:
shell> go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/root/.cache/go-build" GOENV="/root/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/data/sde/go/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/data/sde/go/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/data/sde/go/go/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build836892028=/tmp/go-build -gno-record-gcc-switches"其它
https://studygolang.com/articles/13957?fr=sidebar
https://studygolang.com/articles/24952#reply0
https://studygolang.com/dl
總結(jié)
以上是生活随笔為你收集整理的【Get 以太坊技能】CentOS 7 安装 go的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 劳动部认证的职业资格证书有哪些(国家承认
- 下一篇: 【Get 以太坊技能】CentOS 7