Golang

来自linux中国网wiki
Evan讨论 | 贡献2020年6月9日 (二) 08:47的版本 →‎IDE
跳到导航 跳到搜索

install

wget -c https://dl.google.com/go/go1.14.4.linux-amd64.tar.gz

tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz

tar  -xvf go1.14.4.linux-amd64.tar.gz  -C /usr/local/

#加入 添加到环境变量
echo 'export PATH=$PATH:/usr/local/go/bin' >>/etc/profile  && source /etc/profile

vi /etc/profile
export PATH=/usr/local/go/bin/:$PATH
export GOPATH=/root/go/  #如果你用root运行
export GOROOT=/usr/local/go/
export GOARCH=amd64
export GOOS=linux
export GOTOOLS=$GOROOT/pkg/tool
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

source /etc/profile


#export PATH=/usr/local/go/bin/:$PATH
#export GOPATH=/root


#以前的文章
#freebsd
 https://dl.google.com/go/go1.12.5.freebsd-amd64.tar.gz
#linux
 curl -o  go1.13.6.linux-amd64.tar.gz   https://dl.google.com/go/go1.13.6.linux-amd64.tar.gz


tar -C /usr/local -xzf go1.12.5.freebsd-amd64.tar.gz



export PATH=$PATH:/usr/local/go/bin

source /etc/profile  #如果修改的是/etc/profile
source $HOME/.profile   #如果修改的是$HOME/.profile

go version



IDE

goland

进入goland的bin目录下执行./goland.sh


go安装与goland破解永久版

emacs

https://stackoverflow.com/questions/1715464/emacs-mode-for-go#1715502

https://www.emacswiki.org/emacs/GoLangMode

see also

https://golang.google.cn/doc/install#install