Skip to content

Commit

Permalink
map in parallel + return err
Browse files Browse the repository at this point in the history
  • Loading branch information
Owen3H committed Apr 22, 2024
1 parent 77c952b commit 1acae78
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"golang.org/x/sync/errgroup"

lo "github.com/samber/lo"
lop "github.com/samber/lo/parallel"
Exp "github.com/the-egg-corp/thundergo/experimental"
)

Expand All @@ -17,7 +17,7 @@ func GetAllPackages() (PackageList, error) {
return nil, err
}

identifiers := lo.Map(communities, func(c Exp.Community, _ int) string {
identifiers := lop.Map(communities, func(c Exp.Community, _ int) string {
return c.Identifier
})

Expand Down Expand Up @@ -52,7 +52,7 @@ func PackagesFromCommunities(communities []Community) (PackageList, error) {
})
}

g.Wait()
err := g.Wait()

return list, nil
return list, err
}

0 comments on commit 1acae78

Please sign in to comment.