1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00

errgroup on compress pipe

This commit is contained in:
Carlos Alexandro Becker 2016-12-30 09:59:24 -02:00
parent 21fb357e53
commit 4ba8843d6a
No known key found for this signature in database
GPG Key ID: E61E2F7DC14AB940

View File

@ -9,6 +9,7 @@ import (
"github.com/goreleaser/releaser/config"
"github.com/goreleaser/releaser/uname"
"golang.org/x/sync/errgroup"
)
type Pipe struct{}
@ -18,15 +19,15 @@ func (Pipe) Name() string {
}
func (Pipe) Work(config config.ProjectConfig) error {
// TODO use a errgroup here?
var g errgroup.Group
for _, system := range config.Build.Oses {
for _, arch := range config.Build.Arches {
if err := create(system, arch, config); err != nil {
return err
}
g.Go(func() error {
return create(system, arch, config)
})
}
}
return nil
return g.Wait()
}
func create(system, arch string, config config.ProjectConfig) error {