try to fix test 'cmdext:TestFailOnStderr'
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 39s

This commit is contained in:
2023-09-25 18:02:48 +02:00
parent a2ba283632
commit c63cf442f8
3 changed files with 14 additions and 10 deletions

View File

@@ -32,8 +32,8 @@ func (pr *pipeReader) Read(listener []CommandListener) (string, string, string,
stdout := ""
go func() {
buf := make([]byte, 128)
for true {
n, out := pr.stdout.Read(buf)
for {
n, err := pr.stdout.Read(buf)
if n > 0 {
txt := string(buf[:n])
stdout += txt
@@ -42,11 +42,11 @@ func (pr *pipeReader) Read(listener []CommandListener) (string, string, string,
lstr.ReadRawStdout(buf[:n])
}
}
if out == io.EOF {
if err == io.EOF {
break
}
if out != nil {
errch <- out
if err != nil {
errch <- err
break
}
}
@@ -61,7 +61,7 @@ func (pr *pipeReader) Read(listener []CommandListener) (string, string, string,
stderr := ""
go func() {
buf := make([]byte, 128)
for true {
for {
n, err := pr.stderr.Read(buf)
if n > 0 {