examples/shaderprecomp/metallib: stop using errgroup

This commit is contained in:
Hajime Hoshi 2024-05-06 17:25:21 +09:00
parent 10d9660125
commit a391da6c77
2 changed files with 6 additions and 10 deletions

View File

@ -68,6 +68,7 @@ func run() error {
srcs = append(srcs, defaultSrc) srcs = append(srcs, defaultSrc)
for _, src := range srcs { for _, src := range srcs {
// Avoid using errgroup.Group.
// Compiling sources in parallel causes a mixed error message on the console. // Compiling sources in parallel causes a mixed error message on the console.
if err := compile(src, tmpdir); err != nil { if err := compile(src, tmpdir); err != nil {
return err return err

View File

@ -24,8 +24,6 @@ import (
"os/exec" "os/exec"
"path/filepath" "path/filepath"
"golang.org/x/sync/errgroup"
"github.com/hajimehoshi/ebiten/v2/shaderprecomp" "github.com/hajimehoshi/ebiten/v2/shaderprecomp"
) )
@ -54,15 +52,12 @@ func run() error {
} }
srcs = append(srcs, defaultSrc) srcs = append(srcs, defaultSrc)
var wg errgroup.Group
for _, src := range srcs { for _, src := range srcs {
source := src // Avoid using errgroup.Group.
wg.Go(func() error { // Compiling sources in parallel causes a mixed error message on the console.
return compile(source, tmpdir) if err := compile(src, tmpdir); err != nil {
}) return err
} }
if err := wg.Wait(); err != nil {
return err
} }
return nil return nil
} }