fix(scan): 修复对struct存在重复属性导致的崩溃

新增了在递归scan对象属性的时候发现嵌套属性名称和当前属性名称一致的时候做了友好错误提示
This commit is contained in:
2025-02-05 13:26:41 +08:00
parent dde9b6f74e
commit ca03e37c18
3 changed files with 7 additions and 3 deletions

View File

@@ -58,7 +58,7 @@ func TestBuilderInsert(t *testing.T) {
Ts: time.Now(), LoadUnitId: "负载单体ID", PInt: &p, NullInt32: sql.NullInt32{Int32: 32, Valid: true},
},
&TaosUser{
TaosTAG: &TaosTAG{DevId: "User001", DevType: "User类型", DataType: "User数据类型001"},
TaosTAG: &TaosTAG{DevId: "User001", DevType: "User类型", DataType: "User数据类型001", Alias: "三儿"},
Ts: time.Now(), Name: "张三",
}, &TaosUser{
TaosTAG: &TaosTAG{DevId: "User002", DevType: "User类型", DataType: "User数据类型002"},