check io.Copy errors in test/e2e/utils.go (#136)

This commit is contained in:
Louis Singer
2024-04-19 19:48:57 +02:00
committed by GitHub
parent 852756eaba
commit 7a58d97a34

View File

@@ -75,12 +75,16 @@ func runCommand(name string, arg ...string) (string, error) {
go func() {
defer wg.Done()
io.Copy(output, stdout)
if _, err := io.Copy(output, stdout); err != nil {
fmt.Fprintf(errb, "error reading stdout: %s", err)
}
}()
go func() {
defer wg.Done()
io.Copy(errorb, stderr)
if _, err := io.Copy(errorb, stderr); err != nil {
fmt.Fprintf(errb, "error reading stderr: %s", err)
}
}()
wg.Wait()