I have an app separated on modules. There are several Entities and CSV module. Csv module supports only struct(Entity), but i want to make CSV module works with any type of entity. Now it works like this:
Csv module receives data from channel and strictly converts it to EverySize
struct. How can I achieve dynamical return type, so it will works with any type of Entity, not only with Everysize
func prepareWrapData(data []feed.WrapExporterChannels) []everysize.EverySizeItem {
var result []everysize.EverySizeItem
for _, value := range data {
result = append(result, *value.EverySizeItem)
}
return result
}