Open fr11nik opened 2 months ago
https://github.com/bxcodec/go-clean-arch/blob/e06c6d0cb37069b0ef56e3df67f80ca130a1ab82/article/service.go#L63 in
for authorID := range mapAuthors { authorID := authorID g.Go(func() error { res, err := a.authorRepo.GetByID(ctx, authorID) if err != nil { return err } chanAuthor <- res return nil }) }
better to do?
authors, err := a.authorRepo.GetByIDS(ctx, authorIDS) if err != nil { return err } for _, author := range authors { chanAuthor <- res }
There's difference in perfomance?
https://github.com/bxcodec/go-clean-arch/blob/e06c6d0cb37069b0ef56e3df67f80ca130a1ab82/article/service.go#L63 in
better to do?