Open
Description
Version
1.67.0
Describe the bug
ini.Key.Time() 方法能将时间数据按 RFC3339 解析,但直接将整个配置数据注入 Golang 结构体,却不按此行为解析。
To reproduce
func ParseTime() {
var cfg struct {
Time time.Time `ini:"time"`
}
err := ini.MapTo(&cfg, []byte(`time=2025-01-04T16:25:00+08:00"`))
if err != nil {
panic(err)
}
fmt.Println(cfg.Time)
fmt.Println(time.Parse(time.RFC3339, "2025-01-04T16:25:00+08:00"))
}
Expected behavior
能将时间数据按 RFC3339 格式注入结构体字段中。
Additional context
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity