Remove unnecessary type washing in factory transformer
This commit is contained in:
parent
e7e511764e
commit
bb204b6b14
@ -87,14 +87,7 @@ func (transformer Transformer) Execute() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can't assert a whole collection, wash types individually for Create,
|
err = transformer.Repository.Create(header.Id, models)
|
||||||
// which needs interface{}
|
|
||||||
var typelessModels []interface{}
|
|
||||||
for _, m := range models {
|
|
||||||
typelessModels = append(typelessModels, m.(interface{}))
|
|
||||||
}
|
|
||||||
|
|
||||||
err = transformer.Repository.Create(header.Id, typelessModels)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error persisting %v record: %v", transformerName, err)
|
log.Printf("Error persisting %v record: %v", transformerName, err)
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user