Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
wln32 committed Oct 19, 2024
1 parent 98172e2 commit e65cd72
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions util/gconv/gconv_struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,30 +298,28 @@ func bindStructWithLoopParamsMap(
continue
}
if !strings.EqualFold(
cachedFieldInfo.RemoveSymbolsFieldName, utils.RemoveSymbols(paramKey)) {
cachedFieldInfo.RemoveSymbolsFieldName,
utils.RemoveSymbols(paramKey)) {
continue
}
paramValue, ok = paramsMap[paramKey]
if ok {
fieldValue = cachedFieldInfo.GetFieldReflectValueFrom(structValue)
if paramValue != nil {
if err = bindVarToStructField(
fieldValue, paramValue, cachedFieldInfo, paramKeyToAttrMap,
fieldValue = cachedFieldInfo.GetFieldReflectValueFrom(structValue)
if paramValue != nil {
if err = bindVarToStructField(
fieldValue, paramValue, cachedFieldInfo, paramKeyToAttrMap,
); err != nil {
return err
}
// handle same field name in nested struct.
if len(cachedFieldInfo.OtherSameNameField) > 0 {
if err = setOtherSameNameField(
cachedFieldInfo, paramValue, structValue, paramKeyToAttrMap,
); err != nil {
return err
}
// handle same field name in nested struct.
if len(cachedFieldInfo.OtherSameNameField) > 0 {
if err = setOtherSameNameField(
cachedFieldInfo, paramValue, structValue, paramKeyToAttrMap,
); err != nil {
return err
}
}
}
usedParamsKeyOrTagNameMap[cachedFieldInfo.FieldName()] = struct{}{}
break
}
usedParamsKeyOrTagNameMap[cachedFieldInfo.FieldName()] = struct{}{}
break
}
}
return nil
Expand Down

0 comments on commit e65cd72

Please sign in to comment.