Skip to content

Commit

Permalink
Minor changes into variable assignment for streamOutput
Browse files Browse the repository at this point in the history
  • Loading branch information
ashrithagoramane committed Sep 27, 2024
1 parent f53e622 commit 28c868c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions venv.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,15 @@ type VenvCommandRunOutput struct {

func streamOutput(stream io.ReadCloser, outString *string) error {
var buff bytes.Buffer
reader := io.TeeReader(stream, &buff)

scanner := bufio.NewScanner(reader)
scanner := bufio.NewScanner(io.TeeReader(stream, &buff))
scanner.Split(bufio.ScanLines)

for scanner.Scan() {
m := scanner.Text()
fmt.Println(m)
}
*outString = fmt.Sprint(buff.String())
*outString = buff.String()

return nil
}
Expand Down

0 comments on commit 28c868c

Please sign in to comment.