cloud.google.com/[email protected] requires golang.org/x/[email protected]

Minio 编译时碰到的问题

问题描述:在对minio源码进行build时出现下面错误
[minio]# go build
go: cloud.google.com/[email protected] requires
golang.org/x/[email protected]: 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/[email protected] requires\n\tgoogle.golang.org/[email protected] requires\n\tgithub.com/golang/[email protected] requires\n\tgoogle.golang.org/[email protected] requires\n\tgithub.com/golang/[email protected]: 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

你可能感兴趣的:(运维,go,minio)