I believe the hosting provider is returning a meta tag for "go.xrfang.cn/hap/v2" when it shouldn't?
> curl https://go.xrfang.cn/hap/v2?go-get=1 <meta name="go-import" content="go.xrfang.cn/hap/v2 git https://e.coding.net/xrfang/go/hap.git"> The above meta tag says that the "go.xrfang.cn/hap/v2" module is at the root of the repository, but it's not. That meta tag would be correct if you completely replaced your v1 module with the v2 module. I think the meta tag needs to be the following for it to work for your current v2 module: <meta name="go-import" content="go.xrfang.cn/hap git https://e.coding.net/xrfang/go/hap.git"> Or, the hosting provider should return a 404 (with no meta tag) for "go.xrfang.cn/hap/v2". Compare the output from Github for a module with a major version directory: > curl https://github.com/wailsapp/wails/v2?go-get=1 Not Found On Wednesday, April 17, 2024 at 5:46:15 AM UTC-4 Xiangrong Fang wrote: > Hello, > <https://stackoverflow.com/posts/78338632/timeline> > > I am developing version 2 of my hap <https://go.xrfang.cn/hap/v2> > package, which is a HTTP API framework. Version 2 is not ready yet, and the > latest release ls v2.0.0-alpha.2, like so: > > * 9319436 - bug fix, refined action error output (HEAD -> master, tag: > v2.0.0-alpha.2, origin/master, origin/HEAD) > * 2b1046a - various improvements (20 hours ago) > * 464dcb7 - example: added source IP control and global logging (tag: > v2.0.0-alpha.1) > * 94d6607 - reversed finalizer execution order > * 7604144 - added global actions and finalizers > ... ... > > The directory structure of the entire repo is: > > ├── example/ > ├── go.mod > ├── LICENSE > ├── README.md > └── v2/ > ├── go.mod > └── example/ > > The go.mod under the root directory is: > > module go.xrfang.cn/hap > go 1.17 > > while v2/go.mod looks like: > > module go.xrfang.cn/hap/v2 > go 1.22.1 > > The problem now is go failed to get the v2 pre-release, go mod tidy under > a project using hap/v2: > > go: downloading go.xrfang.cn/hap/v2 v2.0.0-alpha.2 > go: usermgr imports > go.xrfang.cn/hap/v2: go.mod has non-.../v2 module path " > go.xrfang.cn/hap" at revision v2.0.0-alpha.2 > go: usermgr imports > go.xrfang.cn/hap/v2/api: go.mod has non-.../v2 module path " > go.xrfang.cn/hap" at revision v2.0.0-alpha.2 > go: usermgr imports > ... ... > > Using go get: > > $ GOPROXY=direct go get -u -v -x go.xrfang.cn/hap/v...@v2.0.0-alpha.2 > <http://go.xrfang.cn/hap/v2@v2.0.0-alpha.2> > # get https://go.xrfang.cn/hap/v2?go-get=1 > # get https://go.xrfang.cn/hap/v2?go-get=1: 200 OK (0.196s) > get "go.xrfang.cn/hap/v2": found meta tag vcs.metaImport{Prefix:" > go.xrfang.cn/hap/v2", VCS:"git", RepoRoot:" > https://e.coding.net/xrfang/go/hap.git"} at //go.xrfang.cn/hap/v2?go-get=1 > mkdir -p /home/xrfang/go/pkg/mod/cache/vcs # git3 > https://e.coding.net/xrfang/go/hap.git > # lock > /home/xrfang/go/pkg/mod/cache/vcs/0f263e071aed73ec9ef118d38d27fc7cbbcc33f1c19bbac5423684b8b560e3f9.lock > # > /home/xrfang/go/pkg/mod/cache/vcs/0f263e071aed73ec9ef118d38d27fc7cbbcc33f1c19bbac5423684b8b560e3f9 > > for git3 https://e.coding.net/xrfang/go/hap.git > cd > /home/xrfang/go/pkg/mod/cache/vcs/0f263e071aed73ec9ef118d38d27fc7cbbcc33f1c19bbac5423684b8b560e3f9; > > git tag -l > 0.002s # cd > /home/xrfang/go/pkg/mod/cache/vcs/0f263e071aed73ec9ef118d38d27fc7cbbcc33f1c19bbac5423684b8b560e3f9; > > git tag -l > cd > /home/xrfang/go/pkg/mod/cache/vcs/0f263e071aed73ec9ef118d38d27fc7cbbcc33f1c19bbac5423684b8b560e3f9; > > git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H > %ct %D' refs/tags/v2.0.0-alpha.2 -- > 0.003s # cd > /home/xrfang/go/pkg/mod/cache/vcs/0f263e071aed73ec9ef118d38d27fc7cbbcc33f1c19bbac5423684b8b560e3f9; > > git -c log.showsignature=false log --no-decorate -n1 '--format=format:%H > %ct %D' refs/tags/v2.0.0-alpha.2 -- > cd > /home/xrfang/go/pkg/mod/cache/vcs/0f263e071aed73ec9ef118d38d27fc7cbbcc33f1c19bbac5423684b8b560e3f9; > > git cat-file blob 931943650fcb745bf3219ad4bf1ca93177047a5a:go.mod > 0.002s # cd > /home/xrfang/go/pkg/mod/cache/vcs/0f263e071aed73ec9ef118d38d27fc7cbbcc33f1c19bbac5423684b8b560e3f9; > > git cat-file blob 931943650fcb745bf3219ad4bf1ca93177047a5a:go.mod > go: go.xrfang.cn/hap/v...@v2.0.0-alpha.2 > <http://go.xrfang.cn/hap/v2@v2.0.0-alpha.2>: go.mod has non-.../v2 module > path "go.xrfang.cn/hap" at revision v2.0.0-alpha.2 > > > > > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/8f42f5cf-a69b-43c9-92e2-b72b8e1b90c8n%40googlegroups.com.