Skip to content

Commit

Permalink
close readers when done with reading (#557)
Browse files Browse the repository at this point in the history
Signed-off-by: Rafael Matias <[email protected]>
  • Loading branch information
skylenet authored Jun 26, 2023
1 parent 3f3e700 commit 054d55e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/exec/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ func (p ProcessExecutor) RunProcess(executable string, execArgs ...interface{})

scanner := bufio.NewScanner(io.MultiReader(outReader, errReader))
go func() {
defer outReader.Close()
defer errReader.Close()
for scanner.Scan() {
fmt.Println(scanner.Text())
}
Expand Down

0 comments on commit 054d55e

Please sign in to comment.