Skip to content

go mod tidy: import private package only support two slash? #70990

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
so2bin opened this issue Dec 25, 2024 · 2 comments
Closed

go mod tidy: import private package only support two slash? #70990

so2bin opened this issue Dec 25, 2024 · 2 comments

Comments

@so2bin
Copy link

so2bin commented Dec 25, 2024

Go version

go version go1.23.1 linux/amd64

Output of go env in your module/workspace:

GO111MODULE='auto'
GOARCH='amd64'
GOBIN='/home/hbb/go/bin'
GOCACHE='/home/hbb/.cache/go-build'
GOENV='/home/hbb/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMODCACHE='/home/hbb/go/pkg/mod/'
GONOPROXY='xxx.kingsoft.net,'
GONOSUMDB='xxx.kingsoft.net,'
GOOS='linux'
GOPATH='/home/hbb/go/pkg/mod/'
GOPRIVATE='xxx.kingsoft.net,'
GOPROXY='https://mirrors.wps.cn/go/,https://goproxy.cn,direct'
GOROOT='/usr/local/go'
GOSUMDB='off'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.23.1'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/home/hbb/.config/go/telemetry'
GCCGO='gccgo'
GOAMD64='v1'
AR='ar'
CC='gcc'
CXX='g++'
CGO_ENABLED='1'
GOMOD='/home/hbb/projs/wpscp/fl-stress/klink-config-server/go.mod'
GOWORK='/home/hbb/projs/wpscp/fl-stress/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 -ffile-prefix-map=/tmp/go-build3547126021=/tmp/go-build -gno-record-gcc-switches'

What did you do?

  • I have two gitlab project:
xxx.kingsoft.net/sre/klink-stress/libs/common.git
xxx.kingsoft.net/sre/klink-stress/libs/sdk.git

and xxx.kingsoft.net/sre/klink-stress is only a gitlab group.

What did you see happen?

  • There is a project import these two packages:
module xxx.kingsoft.net/sre/klink-stress/klink-config-server

go 1.23.1

require (
	xxx.kingsoft.net/sre/klink-stress/libs/common v0.0.4
	xxx.kingsoft.net/sre/klink-stress/libs/sdk v0.0.9
)
  • I run this command: go mod tidy -x, but I got the following error:
$ go mod tidy -x
go: downloading xxx.kingsoft.net/sre/klink-stress/libs/sdk v0.0.9
# get https://xxx.kingsoft.net/sre/klink-stress/libs/sdk?go-get=1
go: downloading xxx.kingsoft.net/sre/klink-stress/libs/common v0.0.4
# get https://xxx.kingsoft.net/sre/klink-stress/libs/common?go-get=1
# get https://xxx.kingsoft.net/sre/klink-stress/libs/common?go-get=1: 200 OK (0.035s)
# get https://xxx.kingsoft.net/sre/klink-stress?go-get=1
# get https://xxx.kingsoft.net/sre/klink-stress/libs/sdk?go-get=1: 200 OK (0.039s)
# get https://xxx.kingsoft.net/sre/klink-stress?go-get=1: 200 OK (0.024s)
mkdir -p /home/hbb/go/pkg/mod/cache/vcs # git3 https://xxx.kingsoft.net/sre/klink-stress.git
# lock /home/hbb/go/pkg/mod/cache/vcs/09b3075bf7e4fda792f335539d99abbbe590300b2635377a1673d5cd8f3a9255.lock
# /home/hbb/go/pkg/mod/cache/vcs/09b3075bf7e4fda792f335539d99abbbe590300b2635377a1673d5cd8f3a9255 for git3 https://xxx.kingsoft.net/sre/klink-stress.git
cd /home/hbb/go/pkg/mod/cache/vcs/09b3075bf7e4fda792f335539d99abbbe590300b2635377a1673d5cd8f3a9255; git tag -l
0.001s # cd /home/hbb/go/pkg/mod/cache/vcs/09b3075bf7e4fda792f335539d99abbbe590300b2635377a1673d5cd8f3a9255; git tag -l
cd /home/hbb/go/pkg/mod/cache/vcs/09b3075bf7e4fda792f335539d99abbbe590300b2635377a1673d5cd8f3a9255; git ls-remote -q origin
0.097s # cd /home/hbb/go/pkg/mod/cache/vcs/09b3075bf7e4fda792f335539d99abbbe590300b2635377a1673d5cd8f3a9255; git ls-remote -q origin
# get https://xxx.kingsoft.net/sre/klink-stress.git
# get https://xxx.kingsoft.net/sre/klink-stress.git: 200 OK (0.099s)
go: xxx.kingsoft.net/sre/klink-stress/klink-config-server/internal/confscenter imports
        xxx.kingsoft.net/sre/klink-stress/libs/common/types: reading xxx.kingsoft.net/sre/klink-stress/libs/common/go.mod at revision libs/common/v0.0.4: git ls-remote -q origin in /home/hbb/go/pkg/mod/cache/vcs/09b3075bf7e4fda792f335539d99abbbe590300b2635377a1673d5cd8f3a9255: exit status 128:
        remote: The project you were looking for could not be found or you don't have permission to view it.
        fatal: repository 'https://xxx.kingsoft.net/sre/klink-stress.git/' not found

What did you expect to see?

@seankhliao
Copy link
Member

see above previous issues.

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 Dec 25, 2024
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