Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
gqcn committed Mar 3, 2025
1 parent 65172fb commit f97a6fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion util/gconv/internal/converter/converter_struct.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func (c *Converter) bindVarToStructField(
customConverterInput reflect.Value
ok bool
)
if cachedFieldInfo.IsCustomConvert {
if cachedFieldInfo.HasCustomConvert {
if customConverterInput, ok = srcValue.(reflect.Value); !ok {
customConverterInput = reflect.ValueOf(srcValue)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ type CachedFieldInfoBase struct {
// Purpose: reduce the interface asserting cost in runtime.
IsCommonInterface bool

// IsCustomConvert marks there custom converting function for this field type.
// HasCustomConvert marks there custom converting function for this field type.
// A custom converting function is a function that user defined for converting specified type
// to another type.
IsCustomConvert bool
HasCustomConvert bool

// StructField is the type info of this field.
StructField reflect.StructField
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func (csi *CachedStructInfo) makeCachedFieldInfo(
StructField: field,
FieldIndexes: fieldIndexes,
ConvertFunc: csi.genFieldConvertFunc(field.Type),
IsCustomConvert: csi.checkTypeHasCustomConvert(field.Type),
HasCustomConvert: csi.checkTypeHasCustomConvert(field.Type),
PriorityTagAndFieldName: csi.genPriorityTagAndFieldName(field, priorityTags),
RemoveSymbolsFieldName: utils.RemoveSymbols(field.Name),
}
Expand Down

0 comments on commit f97a6fa

Please sign in to comment.