Summary
The v2.0.0 tag ships a go.mod that still declares module github.com/kunchenguid/treehouse (no /v2). Go's semantic import versioning requires a module released at major version ≥ 2 to have its module path end in the matching /vN suffix. As a result, v2.0.0 cannot be installed with go install by any path, and @latest silently resolves to the old v1.8.0.
Reproduction (Go 1.2x, from an empty module)
$ go install github.com/kunchenguid/treehouse@v2.0.0
go: ...@v2.0.0: invalid version: module contains a go.mod file, so module
path must match major version ("github.com/kunchenguid/treehouse/v2")
$ go install github.com/kunchenguid/treehouse/v2@v2.0.0
go: ...v2@v2.0.0: invalid version: go.mod has non-.../v2 module path
"github.com/kunchenguid/treehouse" (and .../v2/go.mod does not exist) at revision v2.0.0
$ go list -m -versions github.com/kunchenguid/treehouse
github.com/kunchenguid/treehouse v1.0.0 ... v1.8.0 # v2.0.0 is absent
$ go list -m github.com/kunchenguid/treehouse@latest
github.com/kunchenguid/treehouse v1.8.0 # @latest silently pins v1.8.0
Impact
- The README's documented install —
go install github.com/kunchenguid/treehouse@latest — does not error; it silently installs v1.8.0. Users following the README never receive v2.x and get no signal that anything is wrong.
- Explicit
@v2.0.0 and the /v2 path both hard-fail. There is no working go install for v2+.
Root cause
go.mod at tag v2.0.0:
module github.com/kunchenguid/treehouse // must be .../v2 for a v2+ release
Suggested fix (standard major-version migration)
- Set the module path to
github.com/kunchenguid/treehouse/v2 in go.mod.
- Update every internal import of
github.com/kunchenguid/treehouse/... to .../v2/....
- Update the README install command to
go install github.com/kunchenguid/treehouse/v2@latest.
- Re-tag (e.g.
v2.0.1) from the corrected commit.
Refs: Module version numbering · Go Modules: v2 and Beyond
Workaround for users until a fixed tag ships
git clone --branch v2.0.0 --depth 1 https://github.com/kunchenguid/treehouse
cd treehouse && make build VERSION=v2.0.0
cp treehouse ~/.local/bin/ # or "$(go env GOBIN)"
Summary
The
v2.0.0tag ships ago.modthat still declaresmodule github.com/kunchenguid/treehouse(no/v2). Go's semantic import versioning requires a module released at major version ≥ 2 to have its module path end in the matching/vNsuffix. As a result, v2.0.0 cannot be installed withgo installby any path, and@latestsilently resolves to the oldv1.8.0.Reproduction (Go 1.2x, from an empty module)
Impact
go install github.com/kunchenguid/treehouse@latest— does not error; it silently installs v1.8.0. Users following the README never receive v2.x and get no signal that anything is wrong.@v2.0.0and the/v2path both hard-fail. There is no workinggo installfor v2+.Root cause
go.modat tagv2.0.0:Suggested fix (standard major-version migration)
github.com/kunchenguid/treehouse/v2ingo.mod.github.com/kunchenguid/treehouse/...to.../v2/....go install github.com/kunchenguid/treehouse/v2@latest.v2.0.1) from the corrected commit.Refs: Module version numbering · Go Modules: v2 and Beyond
Workaround for users until a fixed tag ships