cloud.google.com/go@v0.39.0 requires golang.org/x/text@v0.3.1

Minio 编译时碰到的问题

问题描述:在对minio源码进行build时出现下面错误
[minio]# go build
go: cloud.google.com/go@v0.39.0 requires
golang.org/x/text@v0.3.1-0.20180807135948-17ff2d5776d2: invalid version: git fetch --unshallow -f origin in /root/go/pkg/mod/cache/vcs/38515699458adac9c8b61a0b44f9ad7a5f6edd7bcc2d7fae95930ec78f71e1b4: exit status 128:
fatal: git fetch-pack: expected shallow list

VScode中的错误信息
{
“resource”: “/…/minio/cmd/fs-v1.go”,
“owner”: “go”,
“severity”: 8,
“message”: “go: github.com/nats-io/nats-server/v2@v2.1.7 requires\n\tgoogle.golang.org/protobuf@v1.22.0 requires\n\tgithub.com/golang/protobuf@v1.4.0 requires\n\tgoogle.golang.org/protobuf@v1.21.0 requires\n\tgithub.com/golang/protobuf@v1.4.0-rc.4.0.20200313231945-b860323f09d0: invalid version: git fetch --unshallow -f origin in /…/go/pkg/mod/cache/vcs/6e18cbff36266c74e48dd81b4b672026ac74fb69c838ddb6240f256bb8edf590: exit status 128:\n\tfatal: git fetch-pack: expected shallow list\n”,
“source”: “go”,
“startLineNumber”: 1,
“startColumn”: 1,
“endLineNumber”: 1,
“endColumn”: 3
}

环境:机器在美国;redhat 7.7
解决方法
原本系统中go由 yum install go安装,版本为1.15.2
后来从官网下载安装了 go 1.15.4 编译成功

Install  Go on linux
wget https://golang.google.cn/doc/install?download=go1.15.4.linux-amd64.tar.gz
tar -C /usr/local -xzf go1.15.4.linux-amd64.tar.gz
vim /etc/profile
//add at the end
export PATH=$PATH:/usr/local/go/bin
source /etc/profile
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值