bug fix:修复可能的panic状态;增加更多功能

This commit is contained in:
2026-03-20 13:36:59 +08:00
parent 8f1a9893bc
commit e0af498fa4
39 changed files with 5643 additions and 974 deletions
+12
View File
@@ -0,0 +1,12 @@
package scanutil
// CloneScannedValue copies driver-scanned values that may be reused by driver.
// []byte is deep-copied; other types are returned as-is.
func CloneScannedValue(val interface{}) interface{} {
if b, ok := val.([]byte); ok {
copied := make([]byte, len(b))
copy(copied, b)
return copied
}
return val
}