refactor: 移除 ScanStruct 中 time.Time 直接存储的特殊处理,同步更新测试精度预期

This commit is contained in:
2026-06-02 17:24:10 +08:00
parent 2a3f0afa6e
commit 1e9a16b693
2 changed files with 6 additions and 17 deletions
+2 -8
View File
@@ -198,14 +198,8 @@ func (s *scanner) ScanStruct(i interface{}) error {
record := map[string]interface{}{}
for index, col := range s.columns {
if pi, ok := scans[index].(*interface{}); ok {
v := *pi
if t, isTime := v.(time.Time); isTime {
// time.Time 直接存储,避免格式化字符串丢失纳秒和时区
record[col] = t
} else {
raw := toJSONRawMessage(v)
record[col] = &raw
}
raw := toJSONRawMessage(*pi)
record[col] = &raw
} else {
record[col] = scans[index]
}