Repository navigation
v0.5.0
Release of oekit/core v0.5.0(annotated tag,由 release_train 门禁后打点)。
变更记录
Added
configstruct tag 增强(additive,不改现有行为;不做 go-zero 全套 mapping 引擎):
独立 tagdefault:"8080"/env:"MYAPP_PORT"/range:"(0,100]"/options:"dev,prod",
三个导出入口FillDefaults/ApplyEnv/ValidateTags(共享单个反射 walker);
LoadBootstrapunmarshal 后自动接线 ApplyEnv → FillDefaults → ValidateTags,
非结构体配置类型(如 map)跳过以保持旧行为- 优先级(写死):yaml 显式值 > env tag(env 有值且字段零值时才填)> default tag;
零值歧义(yaml 显式port: 0与未写不可区分、会被 default 覆盖)见 config/doc.go - 支持类型:标量(string/int*/uint*/float*/bool)、time.Duration(time.ParseDuration
文法)、[]string(default/env 逗号切分);range 仅数值字段(Duration 边界用
duration 文法如(0,30s];四种区间 + 单端[a,)/(,b]+ 小数边界),
options 仅 string 字段;tag 非法/值越界 fail-closed 报错且携带字段路径
(嵌套Server.Port、切片Items[1].Qty) - 遍历:嵌套 struct、*struct(nil 按需分配)、[]struct / []*struct;不遍历 map;
跳过非导出字段。ConfigWatcher不自动执行这些 pass(parser 由调用方提供,
可在 parser 里自行调用)
矩阵内依赖地板(该 tag 的 go.mod,CI 验证过的组合)
github.com/oekit/logx v0.1.9