Skip to content

Commit

Permalink
close readers when done with reading
Browse files Browse the repository at this point in the history
  • Loading branch information
skylenet committed May 31, 2023
1 parent 373aa72 commit 37afcf1
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 37afcf1

Please sign in to comment.