From bb204b6b14a45073c637ed90fc6c74dfbd7dd753 Mon Sep 17 00:00:00 2001 From: Edvard Date: Fri, 19 Oct 2018 15:44:55 +0200 Subject: [PATCH] Remove unnecessary type washing in factory transformer --- pkg/transformers/factories/transformer.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/transformers/factories/transformer.go b/pkg/transformers/factories/transformer.go index 8b7574b3..93c7048e 100644 --- a/pkg/transformers/factories/transformer.go +++ b/pkg/transformers/factories/transformer.go @@ -87,14 +87,7 @@ func (transformer Transformer) Execute() error { return err } - // Can't assert a whole collection, wash types individually for Create, - // which needs interface{} - var typelessModels []interface{} - for _, m := range models { - typelessModels = append(typelessModels, m.(interface{})) - } - - err = transformer.Repository.Create(header.Id, typelessModels) + err = transformer.Repository.Create(header.Id, models) if err != nil { log.Printf("Error persisting %v record: %v", transformerName, err) return err