go语言linux安装

675人浏览 / 0人评论

https://www.jianshu.com/p/16159b30c890

https://go.dev/dl/go1.18.1.linux-amd64.tar.gz

go env -w GOPROXY=https://goproxy.cn,https://mirrors.aliyun.com/goproxy/,https://goproxy.io,direct

go env -w GOPROXY=https://goproxy.cn
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,https://mirrors.aliyun.com/goproxy/,https://goproxy.io,direct
export  GOPROXY=https://goproxy.cn,https://mirrors.aliyun.com/goproxy/,https://goproxy.io,direct
go mod init watch
go mod tidy
go mod verify
go mod vendor
go build main.go

遇到的问题
====
        module declares its path as: go.etcd.io/bbolt
                but was required as: github.com/coreos/bbolt
解决
[root@ops-test-32-91 src]# go mod edit -replace github.com/coreos/bbolt@v1.3.4=go.etcd.io/bbolt@v1.3.4

go mod edit -replace google.golang.org/grpc=google.golang.org/grpc@v1.26.0
####go mod edit -replace google.golang.org/grpc@v1.29.1=google.golang.org/grpc@v1.26.0

全部评论