go install fails, go.mod has no /v2 despite v2.x.x tags

Author: mkhoroshevCreated Aug 22, 2026Updated Aug 22, 2026
Labels反馈问题

问题描述

go install github.com/XIU2/[email protected] fails - go.mod has no /v2 despite v2.x.x tags

$ go install github.com/XIU2/[email protected] go: ...: invalid version: module contains a go.mod file, so module path must match major version ("github.com/XIU2/CloudflareSpeedTest/v2")

Adding /v2 to the path doesn't help — go.mod doesn't declare it either. Go's semantic import versioning requires any vX.Y.Z tag with X≥2 to have a matching /vX module path, regardless of whether there was an actual breaking v2 change. Since CFST's tags just follow ordinary release numbering, go install can't resolve any tag ≥ v2.0.0 at all.

Workaround: git clone --branch v2.3.5 --depth 1 ... + go build directly, bypassing the module-proxy check.

Not asking for a full /v2 rename (disruptive for anyone importing this as a library) — just flagging in case it's worth a README note or a future consideration.

Thanks!

软件版本

v2.3.5

附加截图

No response

Source: XIU2/CloudflareSpeedTest