refactor: 移除 ScanStruct 中 time.Time 直接存储的特殊处理,同步更新测试精度预期
This commit is contained in:
+2
-8
@@ -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]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user