You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.4 KiB
52 lines
1.4 KiB
# 配置Golang环境
|
|
wget -c https://studygolang.com/dl/golang/go1.14.6.linux-amd64.tar.gz
|
|
tar -C /usr/local/ -zxvf go1.14.6.linux-amd64.tar.gz
|
|
|
|
echo "export PATH=$PATH:/usr/local/go/bin:/home/user/go/bin" >> /etc/profile.d/go.sh
|
|
source /etc/profile.d/go.sh
|
|
|
|
mkdir -p ~/home/user/go
|
|
echo "export GOPATH=/home/user/go" >> /etc/profile.d/gopath.sh
|
|
#设置代理
|
|
echo "export GO111MODULE=on" >> /etc/profile.d/gopath.sh
|
|
echo "export GOPROXY=https://goproxy.cn,direct" >> /etc/profile.d/gopath.sh
|
|
|
|
source /etc/profile.d/gopath.sh
|
|
chmod +x /etc/profile.d/*.sh
|
|
echo $GOPATH
|
|
|
|
|
|
# 下载dlv
|
|
yum install git -y
|
|
go get github.com/go-delve/delve/cmd/dlv
|
|
|
|
# Goland配置方法
|
|
https://www.jianshu.com/p/e74e940a64d9
|
|
|
|
cd /usr/local/dsMin/dsBaseRpc
|
|
dlv --listen=:2345 --headless=true --api-version=2 exec ./dsBaseRpc
|
|
|
|
# 构建
|
|
:: 创建Linux发布版本
|
|
SET GOOS=linux
|
|
SET GOARCH=amd64
|
|
go build -gcflags "all=-N -l" -o ./build/dsBaseRpc main.go
|
|
|
|
//构建一个强制转换的错误~~~~
|
|
//panic(400)
|
|
|
|
#golang解决中文乱码的方法
|
|
https://www.cnblogs.com/mo3408/p/12216695.html
|
|
|
|
|
|
go mod download
|
|
|
|
【Go第三方包代理】Go第三方包代理设置 — GOPROXY
|
|
https://blog.csdn.net/tmt123421/article/details/88665248
|
|
|
|
|
|
goland如何去除注释中的下划波浪线
|
|
https://blog.csdn.net/HYZX_9987/article/details/118183567
|
|
|
|
Go ORM框架XORM事务的示例
|
|
https://www.jianshu.com/p/3ddcbd08bcf6 |