Skip to content

support subdirectory config for go-get since go 1.25 #35285

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

a1012112796
Copy link
Member

@a1012112796 a1012112796 commented Aug 15, 2025

ref: golang/go@835e36f

close #35135

example view:

6ae47154184d524565957ddd833ea100
2eb1ceee4741f1ceaa34547b0f99f903

go get test result:

# get https://private.zhao1012112796.top/?go-get=1
# get https://private.zhao1012112796.top/testg?go-get=1
# get https://private.zhao1012112796.top/testg/test_repo?go-get=1
# get https://private.zhao1012112796.top/testg/test_repo?go-get=1: 200 OK (0.027s)
# get https://private.zhao1012112796.top/?go-get=1: 200 OK (0.029s)
get "private.zhao1012112796.top/testg/test_repo": found meta tag vcs.metaImport{Prefix:"private.zhao1012112796.top/testg/test_repo", VCS:"git", RepoRoot:"https://private.zhao1012112796.top/testg/test_repo.git", SubDir:"haha"} at //private.zhao1012112796.top/testg/test_repo?go-get=1
mkdir -p C:\Users\zzc\go\pkg\mod\cache\vcs # git3 https://private.zhao1012112796.top/testg/test_repo.git
# lock C:\Users\zzc\go\pkg\mod\cache\vcs\77054afae63cbb57d438e03e37c62470cbdab339bba361937e2b4fdc7de818a3.lock
# C:\Users\zzc\go\pkg\mod\cache\vcs\77054afae63cbb57d438e03e37c62470cbdab339bba361937e2b4fdc7de818a3 for git3 https://private.zhao1012112796.top/testg/test_repo.git
cd C:\Users\zzc\go\pkg\mod\cache\vcs\77054afae63cbb57d438e03e37c62470cbdab339bba361937e2b4fdc7de818a3; git config extensions.objectformat
# get https://private.zhao1012112796.top/testg?go-get=1: 200 OK (0.030s)
0.016s # cd C:\Users\zzc\go\pkg\mod\cache\vcs\77054afae63cbb57d438e03e37c62470cbdab339bba361937e2b4fdc7de818a3; git config extensions.objectformat
cd C:\Users\zzc\go\pkg\mod\cache\vcs\77054afae63cbb57d438e03e37c62470cbdab339bba361937e2b4fdc7de818a3; git ls-remote -q origin
0.060s # cd C:\Users\zzc\go\pkg\mod\cache\vcs\77054afae63cbb57d438e03e37c62470cbdab339bba361937e2b4fdc7de818a3; git ls-remote -q origin
cd C:\Users\zzc\go\pkg\mod\cache\vcs\77054afae63cbb57d438e03e37c62470cbdab339bba361937e2b4fdc7de818a3; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' 140fbb298455c311df6f8242316f406308fa3ffe --
0.017s # cd C:\Users\zzc\go\pkg\mod\cache\vcs\77054afae63cbb57d438e03e37c62470cbdab339bba361937e2b4fdc7de818a3; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' 140fbb298455c311df6f8242316f406308fa3ffe --
cd C:\Users\zzc\go\pkg\mod\cache\vcs\77054afae63cbb57d438e03e37c62470cbdab339bba361937e2b4fdc7de818a3; git for-each-ref --format %(refname) refs/tags --merged 140fbb298455c311df6f8242316f406308fa3ffe
0.016s # cd C:\Users\zzc\go\pkg\mod\cache\vcs\77054afae63cbb57d438e03e37c62470cbdab339bba361937e2b4fdc7de818a3; git for-each-ref --format %(refname) refs/tags --merged 140fbb298455c311df6f8242316f406308fa3ffe
cd C:\Users\zzc\go\pkg\mod\cache\vcs\77054afae63cbb57d438e03e37c62470cbdab339bba361937e2b4fdc7de818a3; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' 140fbb298455 --
0.015s # cd C:\Users\zzc\go\pkg\mod\cache\vcs\77054afae63cbb57d438e03e37c62470cbdab339bba361937e2b4fdc7de818a3; git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H %ct %D' 140fbb298455 --
cd C:\Users\zzc\go\pkg\mod\cache\vcs\77054afae63cbb57d438e03e37c62470cbdab339bba361937e2b4fdc7de818a3; git cat-file blob 140fbb298455c311df6f8242316f406308fa3ffe:haha/go.mod
0.016s # cd C:\Users\zzc\go\pkg\mod\cache\vcs\77054afae63cbb57d438e03e37c62470cbdab339bba361937e2b4fdc7de818a3; git cat-file blob 140fbb298455c311df6f8242316f406308fa3ffe:haha/go.mod

ref: golang/go@835e36f

Signed-off-by: a1012112796 <1012112796@qq.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Aug 15, 2025
@github-actions github-actions bot added modifies/translation modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files labels Aug 15, 2025
Copy link
Member

@techknowlogick techknowlogick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure if the package code should be involved, as the meta import tag also exists for regular repositories.

@GiteaBot GiteaBot added lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Aug 15, 2025
@a1012112796

This comment was marked as outdated.

@a1012112796
Copy link
Member Author

I'm unsure if the package code should be involved, as the meta import tag also exists for regular repositories.

Or maybe add maybe add a special unit named as misc to sore these special repo level configs? in my view store config in units is a better way than others since #22500 was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/blocked A maintainer has reservations with the PR and thus it cannot be merged modifies/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/translation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

adapt subdirectory in go-import for go 1.25
3 participants