0006. Migrate to /v2 module path¶
Context¶
ADR 0005 decided to keep the module on the v1 import path
(github.com/shing1211/webullapi4go) and treat v2.x Git tags as
repository-only, non-installable markers. The Go module proxy therefore served
only v1.1.1, and consumers pinned commits to reach newer work.
The maintainer has now authorized a /v2 migration and a published Go-semver
v2 module release.
Decision¶
The module path is now:
Every import statement, go.mod declaration, replace directive, buf.gen.yaml
M mapping, and golangci-lint local-prefixes carries the /v2 suffix. The
first installable Go-semver v2 tag is v2.2.0. The 66 prior v2.1.x repository
tags declared the pre-migration module path and were not installable; they have
been deleted from both remotes (origin and gitee).
Rationale¶
- Installability:
go get github.com/shing1211/webullapi4go/v2@latestresolves tov2.2.0instead of failing or falling back tov1.1.1. - Semantic import versioning: Go requires the major version in the module
path for v2+. Carrying
/v2is the idiomatic mechanism. - Clean release: Deleting the non-installable
v2.1.xtags prevents them from polluting@latestresolution — av2.1.40tag whosego.moddeclares the old path would make@latesterror with "module declares its path as ... not .../v2".
Consequences¶
go get github.com/shing1211/webullapi4go/v2@latestinstallsv2.2.0.- All consumers must update import paths from
github.com/shing1211/webullapi4gotogithub.com/shing1211/webullapi4go/v2. - The
v1.xline (v1.0.0–v1.1.1) remains installable at the old pathgithub.com/shing1211/webullapi4gofor consumers that have not migrated. - The
broker/nested module path isgithub.com/shing1211/webullapi4go/v2/broker. - ADR 0005 is superseded.