You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// // first precedence is exact match (case sensitive)
161
-
// if fieldTo, ok := typeTo.FieldByName(fieldNameFrom); ok {
162
-
// return fieldTo, true
163
-
// }
164
-
165
-
// // If a "from" field fuzzy matches a "to" field, we are certain the fuzzy match
166
-
// // is NOT correct if "from" also contains a field by the fuzzy matched name.
167
-
// // For example, if "from" has "Value" and "Values", "Values" should *never*
168
-
// // fuzzy match "Value" in "to" since "from" also has "Value". We check "from"
169
-
// // to make sure fuzzy matches are not in "from".
170
-
171
-
// // second precedence is exact match (case insensitive)
172
-
// opts := flexer.getOptions()
173
-
// for field := range tfreflect.ExportedStructFields(typeTo) {
174
-
// fieldNameTo := field.Name
175
-
// if opts.isIgnoredField(fieldNameTo) {
176
-
// continue
177
-
// }
178
-
// if fieldTo, ok := typeTo.FieldByName(fieldNameTo); ok && strings.EqualFold(fieldNameFrom, fieldNameTo) && !fieldExistsInStruct(fieldNameTo, typeFrom) {
179
-
// // probably could assume validity here since reflect gave the field name
180
-
// return fieldTo, true
181
-
// }
182
-
// }
183
-
184
-
// // third precedence is singular/plural
185
-
// fieldNameTo := plural.Plural(fieldNameFrom)
186
-
// if plural.IsSingular(fieldNameFrom) && !fieldExistsInStruct(fieldNameTo, typeFrom) {
187
-
// if fieldTo, ok := typeTo.FieldByName(fieldNameTo); ok {
188
-
// return fieldTo, true
189
-
// }
190
-
// }
191
-
192
-
// fieldNameTo = plural.Singular(fieldNameFrom)
193
-
// if plural.IsPlural(fieldNameFrom) && !fieldExistsInStruct(fieldNameTo, typeFrom) {
194
-
// if fieldTo, ok := typeTo.FieldByName(fieldNameTo); ok {
195
-
// return fieldTo, true
196
-
// }
197
-
// }
198
-
199
-
// // fourth precedence is using field name prefix
0 commit comments