mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-10 16:30:01 +08:00
feat(sqlx): add field tag (-) skip logic in unwrapFields (#5010)
Co-authored-by: wukun30 <wukun30@meituan.com>
This commit is contained in:
@@ -279,6 +279,11 @@ func unwrapFields(v reflect.Value) []reflect.Value {
|
||||
if child.Kind() == reflect.Struct && childType.Anonymous {
|
||||
fields = append(fields, unwrapFields(child)...)
|
||||
} else {
|
||||
key := parseTagName(childType)
|
||||
if key == "-" {
|
||||
continue
|
||||
}
|
||||
|
||||
fields = append(fields, child)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user