mirror of
https://github.com/netbirdio/easyjson.git
synced 2026-05-22 18:44:42 -07:00
more strict if
This commit is contained in:
+2
-1
@@ -353,13 +353,14 @@ func getStructFields(t reflect.Type) ([]reflect.StructField, error) {
|
||||
t1 = t1.Elem()
|
||||
}
|
||||
|
||||
|
||||
if t1.Kind() == reflect.Struct {
|
||||
fs, err := getStructFields(t1)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error processing embedded field: %v", err)
|
||||
}
|
||||
efields = mergeStructFields(efields, fs)
|
||||
} else {
|
||||
} else if (t1.Kind() >= reflect.Bool && t1.Kind() < reflect.Complex128) || t1.Kind() == reflect.String {
|
||||
if strings.Contains(f.Name, ".") || unicode.IsUpper([]rune(f.Name)[0]) {
|
||||
fields = append(fields, f)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user