[feat] 增加解决 converting NULL to string is unsupported 的类型

This commit is contained in:
2025-03-22 23:31:12 +08:00
parent 717ae359bc
commit f9ca4a49ce
2 changed files with 7 additions and 2 deletions
+4 -1
View File
@@ -77,7 +77,10 @@ func (s *scanner) ScanStruct(i interface{}) error {
// 处理 converting NULL to string is unsupported
// 前面将 string 和 int 类型转为了 *string 和 *int
switch data.GoType.Kind() {
case reflect.String, reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
case reflect.String,
reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
reflect.Float32, reflect.Float64,
reflect.Bool:
scans = append(scans, reflect.New(reflect.PointerTo(data.GoType)).Interface())
default:
scans = append(scans, reflect.New(data.GoType).Interface())