go
type_error
ai_generated
true
sql: Scan error on column index 0: unsupported Scan, storing driver.Value type int64 into type *string
ID: go/sql-unsupported-destination
80%Fix Rate
90%Confidence
0Evidence
2024-06-05First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 1.21 | active | — | — | — |
Root Cause
数据库列类型与目标变量类型不匹配,如将整数扫描到字符串。
generic中文
数据库列类型与目标变量类型不匹配,如将整数扫描到字符串。
Workarounds
-
90% success
确保目标变量类型与数据库列类型一致,或使用sql.Null类型。
Dead Ends
Common approaches that don't work:
-
50% fail
强制类型转换可能丢失数据。
-
60% fail
忽略错误导致数据错误。