Skip to content

Commit

Permalink
add error check to scanner
Browse files Browse the repository at this point in the history
  • Loading branch information
bcicen committed Dec 6, 2017
1 parent d2b7a8c commit 336252b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ func (s *StdinScanner) StreamBytes() chan []byte {
fmt.Printf("%s", b)
}
}
failOnError(s.Err(), "error reading input")
close(ch)
}()
return ch
Expand All @@ -51,6 +52,7 @@ func (s *StdinScanner) StreamLines() chan string {
fmt.Println(s.Text())
}
}
failOnError(s.Err(), "error reading input")
close(ch)
}()
return ch
Expand Down

0 comments on commit 336252b

Please sign in to comment.