add: error handling to scanner example

This commit is contained in:
Inanc Gumus
2019-04-27 10:45:47 +03:00
parent 8cff19f314
commit 28903ad6c8
7 changed files with 38 additions and 1 deletions

View File

@ -86,4 +86,9 @@ func main() {
// Print the total visits for all domains
fmt.Printf("\n%-30s %10d\n", "TOTAL", p.total)
// Let's handle the error
if err := in.Err(); err != nil {
fmt.Println("> Err:", err)
}
}