动态结构体,字段可导出

This commit is contained in:
zhangdeman committed 2024-08-23 18:30:24 +08:00
1 parent 59ba4ebfa5
commit c38d16dc28
1 file changed
+1
+1
View File
@@ -152,6 +152,7 @@ func (ds *DynamicStruct) AddStructField(field reflect.StructField) {
if field.Tag == "" {
field.Tag = reflect.StructTag(fmt.Sprintf(`json:"%v"`, field.Name))
}
field.Name = String(field.Name).SnakeCaseToCamel() // 转成大驼峰, 保证对外可访问
ds.structFieldList = append(ds.structFieldList, field)
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.