Go version
go version go1.22.2 linux/amd64
Output of go env
in your module/workspace:
GO111MODULE=''
GOARCH='amd64'
GOBIN=''
GOCACHE='/root/.cache/go-build'
GOENV='/root/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/root/go/pkg/mod'
GONOPROXY='code.xxx.com'
GONOSUMDB='code.xxx.com'
GOOS='linux'
GOPATH='/root/go'
GOPRIVATE='code.xxx.com'
GOPROXY='https://goproxy.cn,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.22.2'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/root/code/param_config_service/go.mod'
GOWORK='/root/code/go.work'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build420680952=/tmp/go-build -gno-record-gcc-switches'
What did you do?
I done below steps before go get private package: Step1: set go_private_proxy use code.xxx.com. Step2: set git insteadOf---
[url "git@172.18.x.x:"]
insteadOf = https://code.xxx.com/
My private repo on gitea like:
After I done these steps. I'm use go get
at another repo import utils repo into my project.
I use go get -u code.xxx.com/common/ts_utils
command import utils private package into my other repo. But I get err:
Also I'm try to use go get -v code.teamsun.com/common/ts_utils.git
(extra suffix: .git
)
I think i need to add utils project go.mod:
What did you see happen?
I am not sure why such an error occurs with go get
to my private package.
What did you expect to see?
I tried something else:
1. remove utils go.mod. go get -u xxx/xxx/utils.git
(But I need go.mod file)
2. use replace in import repo go.mod file:
But I need manual to upgrade private pkg when utils code update .
These are some intermediate steps that can be ignored because I don't want the real problem to get lost.
Thank you all in advance for your help.
Comment From: gabyhelp
Similar Issues
- [mod]Go get private repository #34112
- cmd/go: 'go build' error from 'git ls-remote' when downloading from private repo #33836
- cmd/go: failed to fetch private repo with multiple error situations #38345
- go get -u all is attempting to find a VCS repository for a module path that is replaced with a local directory #40326
- cmd/go: "package?go-get=1 404 not found" errors occurs when go get private project in internal private gitlab repository #64223
- go get #56314
- Can't build after a private module has moved #35990
- go mod: something goes wrong with private git projects when imports with the suffix .git #34812
- cmd/go: make the error from 'go get -u' more helpful when the current directory does not contain a package #34079
- proxy.golang.org: 410 gone on public repository when doing a tool import #41887
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Comment From: seankhliao
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