It would be nice to have support for automatically matching fields across embedded structs:
type AuditData struct {
CreatedAt time.Time
UpdatedAt time.Time
}
type A struct {
Name string
CreatedAt time.Time
UpdatedAt time.Time
}
type B struct {
Name string
AuditData
}
var A2B = convgen.Struct[A, B]() // currently this fails because it doesn't match fields inside embedded structs
I know this can be done manually using convgen.Match, but that has to be on a field by field basis, for every converter. It would be nice if we could have a module option for some embedding level of automatic search:
var mod = convgen.Module(convgen.MatchEmbedded(1)) // Match embedded structs automatically, up to one level
// ...
var A2B = convgen.Struct[A, B]() // Would match A.CreatedAt to B.AuditData.CreatedAt, and so on
It would be nice to have support for automatically matching fields across embedded structs:
I know this can be done manually using
convgen.Match, but that has to be on a field by field basis, for every converter. It would be nice if we could have a module option for some embedding level of automatic search: