Skip to content

The go get tool is very slow #71084

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kaylee595 opened this issue Jan 2, 2025 · 2 comments
Closed

The go get tool is very slow #71084

kaylee595 opened this issue Jan 2, 2025 · 2 comments

Comments

@kaylee595
Copy link

Go version

go version go1.23.2 windows/amd64

Output of go env in your module/workspace:

set GO111MODULE=on
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Administrator\AppData\Local\go-build
set GOENV=C:\Users\Administrator\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=gitee.com
set GOMODCACHE=C:\Users\Administrator\go\pkg\mod
set GONOPROXY=gitee.com
set GONOSUMDB=gitee.com
set GOOS=windows
set GOPATH=C:\Users\Administrator\go
set GOPRIVATE=gitee.com
set GOPROXY=https://goproxy.cn,direct
set GOROOT=C:/Program Files/Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.23.2
set GODEBUG=
set GOTELEMETRY=local
set GOTELEMETRYDIR=C:\Users\Administrator\AppData\Roaming\go\telemetry
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=C:\Users\Administrator\code\risheng\system-server\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\Administrator\AppData\Local\Temp\go-build4155287484=/tmp/go-build -gno-record-gcc-switches

What did you do?

go get is slow when pulling private repositories. I don't know how to fix it. Can anyone tell me?

$ go get -x gitee.com/fzrisheng/apple
# get https://gitee.com/?go-get=1
# get https://gitee.com/fzrisheng/apple?go-get=1
# get https://gitee.com/fzrisheng?go-get=1
# get https://gitee.com/fzrisheng/apple?go-get=1: 200 OK (0.410s)
mkdir -p C:\Users\Administrator\go\pkg\mod\cache\vcs # git3 https://gitee.com/fzrisheng/apple.git
# lock C:\Users\Administrator\go\pkg\mod\cache\vcs\8786ae3207e1c9b0a2fb8aa504b89dd221958cddeac8c7dff0e0b3ccf2156480.lock
# C:\Users\Administrator\go\pkg\mod\cache\vcs\8786ae3207e1c9b0a2fb8aa504b89dd221958cddeac8c7dff0e0b3ccf2156480 for git3 https://gitee.com/fzrisheng/apple.git
cd C:\Users\Administrator\go\pkg\mod\cache\vcs\8786ae3207e1c9b0a2fb8aa504b89dd221958cddeac8c7dff0e0b3ccf2156480; git ls-remote -q origin
# get https://gitee.com/?go-get=1: 200 OK (0.419s)
# get https://gitee.com/fzrisheng?go-get=1: 200 OK (0.462s)
mkdir -p C:\Users\Administrator\go\pkg\mod\cache\vcs # git3 https://gitee.com/fzrisheng
# lock C:\Users\Administrator\go\pkg\mod\cache\vcs\5b731c6faccb3fa8b04d464676497866b02a0d0283f182017448ceffeec7076e.lock
# C:\Users\Administrator\go\pkg\mod\cache\vcs\5b731c6faccb3fa8b04d464676497866b02a0d0283f182017448ceffeec7076e for git3 https://gitee.com/fzrisheng
cd C:\Users\Administrator\go\pkg\mod\cache\vcs\5b731c6faccb3fa8b04d464676497866b02a0d0283f182017448ceffeec7076e; git ls-remote -q origin
1.328s # cd C:\Users\Administrator\go\pkg\mod\cache\vcs\8786ae3207e1c9b0a2fb8aa504b89dd221958cddeac8c7dff0e0b3ccf2156480; git ls-remote -q origin
go: downloading gitee.com/fzrisheng/apple v0.11.3
cd C:\Users\Administrator\go\pkg\mod\cache\vcs\8786ae3207e1c9b0a2fb8aa504b89dd221958cddeac8c7dff0e0b3ccf2156480; git tag -l
0.028s # cd C:\Users\Administrator\go\pkg\mod\cache\vcs\8786ae3207e1c9b0a2fb8aa504b89dd221958cddeac8c7dff0e0b3ccf2156480; git tag -l
cd C:\Users\Administrator\go\pkg\mod\cache\vcs\8786ae3207e1c9b0a2fb8aa504b89dd221958cddeac8c7dff0e0b3ccf2156480; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' refs/tags/v0.11.3 --
0.032s # cd C:\Users\Administrator\go\pkg\mod\cache\vcs\8786ae3207e1c9b0a2fb8aa504b89dd221958cddeac8c7dff0e0b3ccf2156480; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' refs/tags/v0.11.3 --
cd C:\Users\Administrator\go\pkg\mod\cache\vcs\8786ae3207e1c9b0a2fb8aa504b89dd221958cddeac8c7dff0e0b3ccf2156480; git cat-file blob 58b472e7aa22b9361ee7233e045b2a914fa63a87:go.mod
0.027s # cd C:\Users\Administrator\go\pkg\mod\cache\vcs\8786ae3207e1c9b0a2fb8aa504b89dd221958cddeac8c7dff0e0b3ccf2156480; git cat-file blob 58b472e7aa22b9361ee7233e045b2a914fa63a87:go.mod
cd C:\Users\Administrator\go\pkg\mod\cache\vcs\8786ae3207e1c9b0a2fb8aa504b89dd221958cddeac8c7dff0e0b3ccf2156480; git cat-file blob 58b472e7aa22b9361ee7233e045b2a914fa63a87:go.mod
0.028s # cd C:\Users\Administrator\go\pkg\mod\cache\vcs\8786ae3207e1c9b0a2fb8aa504b89dd221958cddeac8c7dff0e0b3ccf2156480; git cat-file blob 58b472e7aa22b9361ee7233e045b2a914fa63a87:go.mod
cd C:\Users\Administrator\go\pkg\mod\cache\vcs\8786ae3207e1c9b0a2fb8aa504b89dd221958cddeac8c7dff0e0b3ccf2156480; git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ 58b472e7aa22b9361ee7233e045b2a914fa63a87      
0.042s # cd C:\Users\Administrator\go\pkg\mod\cache\vcs\8786ae3207e1c9b0a2fb8aa504b89dd221958cddeac8c7dff0e0b3ccf2156480; git -c core.autocrlf=input -c core.eol=lf archive --format=zip --prefix=prefix/ 58b472e7aa22b9361ee7233e045b2a914fa63a87
120.778s # cd C:\Users\Administrator\go\pkg\mod\cache\vcs\5b731c6faccb3fa8b04d464676497866b02a0d0283f182017448ceffeec7076e; git ls-remote -q origin
# get https://gitee.com/fzrisheng
# get https://gitee.com/fzrisheng: 200 OK (7.709s)
# get https://goproxy.cn/github.com/tidwall/sjson/@v/list
# get https://goproxy.cn/github.com/andybalholm/cascadia/@v/list
# get https://goproxy.cn/github.com/tidwall/gjson/@v/list
# get https://gitee.com/kaylee595/gkaylee?go-get=1
# get https://goproxy.cn/github.com/kaylee595/cast/@v/list
# get https://goproxy.cn/github.com/tidwall/match/@v/list
# get https://goproxy.cn/golang.org/x/net/@v/list
# get https://goproxy.cn/github.com/tidwall/pretty/@v/list
# get https://goproxy.cn/github.com/kaylee595/tracerr/@v/list
# get https://goproxy.cn/github.com/%21puerkito%21bio/goquery/@v/list
# get https://goproxy.cn/github.com/kaylee595/tracerr/@v/list: 200 OK (0.254s)
# get https://goproxy.cn/github.com/kaylee595/cast/@v/list: 200 OK (0.275s)
# get https://goproxy.cn/github.com/tidwall/match/@v/list: 200 OK (0.304s)
# get https://goproxy.cn/github.com/andybalholm/cascadia/@v/list: 200 OK (0.311s)
# get https://goproxy.cn/github.com/tidwall/sjson/@v/list: 200 OK (0.319s)
# get https://goproxy.cn/github.com/tidwall/gjson/@v/list: 200 OK (0.325s)
# get https://goproxy.cn/golang.org/x/net/@v/list: 200 OK (0.405s)
# get https://goproxy.cn/github.com/%21puerkito%21bio/goquery/@v/list: 200 OK (0.461s)
# get https://goproxy.cn/github.com/tidwall/pretty/@v/list: 200 OK (0.638s)
# get https://gitee.com/kaylee595/gkaylee?go-get=1: 200 OK (0.941s)
mkdir -p C:\Users\Administrator\go\pkg\mod\cache\vcs # git3 https://gitee.com/kaylee595/gkaylee.git
# lock C:\Users\Administrator\go\pkg\mod\cache\vcs\e41c7444732480f5529d27a0389dd7b20e27bff24575d483f6187466a2546de0.lock
# C:\Users\Administrator\go\pkg\mod\cache\vcs\e41c7444732480f5529d27a0389dd7b20e27bff24575d483f6187466a2546de0 for git3 https://gitee.com/kaylee595/gkaylee.git
cd C:\Users\Administrator\go\pkg\mod\cache\vcs\e41c7444732480f5529d27a0389dd7b20e27bff24575d483f6187466a2546de0; git ls-remote -q origin
1.197s # cd C:\Users\Administrator\go\pkg\mod\cache\vcs\e41c7444732480f5529d27a0389dd7b20e27bff24575d483f6187466a2546de0; git ls-remote -q origin
go: upgraded gitee.com/fzrisheng/apple v0.11.2 => v0.11.3

Manually try 120.778s # cd C:\Users\Administrator\go\pkg\mod\cache\vcs\5b731c6faccb3fa8b04d464676497866b02a0d0283f182017448ceffeec7076e; git ls-remote -q origin:

Administrator@CHINAMI-19KFKSK MINGW64 ~/go/pkg/mod/cache/vcs/5b731c6faccb3fa8b04d464676497866b02a0d0283f182017448ceffeec7076e (BARE:master)
$ git ls-remote -q origin
[session-04477fbe] Permission denied: Path 'fzrisheng' is unreachable
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Administrator@CHINAMI-19KFKSK MINGW64 ~/go/pkg/mod/cache/vcs/5b731c6faccb3fa8b04d464676497866b02a0d0283f182017448ceffeec7076e (BARE:master)
$ git remote -v
origin  [email protected]:fzrisheng (fetch)
origin  [email protected]:fzrisheng (push)

What did you see happen?

I configured git to use ssh.
.gitconfig

[user]
	name = kaylee595
	email = [email protected]
[credential "https://gitee.com"]
	provider = generic
[url "[email protected]:"]
	insteadOf = https://gitee.com/

What did you expect to see?

I hope go get can be faster

@seankhliao
Copy link
Member

That's your git operations on your server being slow, not much go can do about it.

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants