赞
踩
1.下载并解压
wget -c https://dl.google.com/go/go1.17.1.linux-amd64.tar.gz -O - | tar -xz -C /usr/local
2.配置环境变量 ,我这里直接给root装
- vi /root/.bashrc
-
- GOROOT=/usr/local/go
- GOPATH=$HOME/go
- GOBIN=$GOPATH/bin
- PATH=$PATH:$GOBIN
- GO111MODULE=on
- GOPROXY=https://goproxy.cn,direct
-
- source一下
这里把源都换好了
3.go -version 查看是不是安装成功了
4.dlv
- mkdir -p $GOPATH/src/golang.org/x
- cd $GOPATH/src/golang.org/x
- git clone https://github.com/golang/net.git
- git clone https://github.com/golang/sys.git
- git clone https://github.com/golang/arch.git
- git clone https://github.com/golang/sync.git
- git clone https://github.com/golang/tools.git
- cd $GOPATH/src
- go get -u github.com/go-delve/delve/cmd/dlv
5.go install一下你安装的包,此时理论上会安装到bin目录下,dlv查看是否安装成功
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。