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: Golang Get error when I use go get command with private package

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: Golang Get error when I use go get command with private package

Also I'm try to use go get -v code.teamsun.com/common/ts_utils.git(extra suffix: .git) Golang Get error when I use go get command with private package

I think i need to add utils project go.mod: Golang Get error when I use go get command with private package

What did you see happen?

I am not sure why such an error occurs with go get to my private package. Golang Get error when I use go get command with private package Golang Get error when I use go get command with 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: Golang Get error when I use go get command with private package

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

(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