Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,16 @@ func (m *mapper) unpackStruct(keys []string, values []interface{}, out reflect.V
convKey = m.conv.ColumnToFieldName(k)
}
field := out.FieldByName(convKey)

// If the field is not found it can mean that we don't want it or that
// we have special case like UserID, UUID, userUUID
// So fix the name and try again
if !field.IsValid() {
convKey = strings.Replace(convKey, "Uuid", "UUID", -1)
convKey = strings.Replace(convKey, "Id", "ID", -1)
field = out.FieldByName(convKey)
}

if field.IsValid() {
m.unpackValue(nil, values[i:i+1], field)
}
Expand Down