Closed jdmeyer3 closed 1 year ago
Goverter can't know how to convert any to any, you need to define the function yourself:
// goverter:converter
// goverter:extend ConvertAny
type ConverterInterface interface {
ConvertHouse(source DBHouseNamesI) APIHouseNamesI
}
type DBHouseNamesI struct {
Name any
}
type APIHouseNamesI struct {
Name any
}
func ConvertAny(source any) any {
return source
}
That works for me, thank you
Is your feature request related to a problem? Please describe. I have several structs that are generated with a type of
interface{}
. Converting an interface to an interface is unsupportedDescribe the solution you'd like Using the example below, allow goverter to convert a struct that has an interface to another struct that has the same interface type
Describe alternatives you've considered Try to get away from a type any, but that is a limitation of other code generations.