Failed to build go-ipfs from source

Hello, I’m using a CentOS 7.8.2003 machine with go version 1.15.5.

I followed the instruction to build go from source.
However, when I run make install, I got the following error:

go version go1.15.5 linux/amd64

bin/check_go_version 1.15.2

plugin/loader/ > plugin/loader/preload.go

go fmt plugin/loader/preload.go >/dev/null

go: requires invalid version: git fetch --unshallow -f origin in /home/cc/go/pkg/mod/cache/vcs/058a6d1022beef311f0280c0f2c60a22067711d31dd0bd3aa7ad35d2847485df: exit status 128:

fatal: git fetch-pack: expected shallow list

make: *** [plugin/loader/preload.go] Error 1

Can anyone help?

Never mind. Resolved it by upgrading git to version 2.x.x.