diff --git a/main.go b/main.go index f09f835..a40dc09 100644 --- a/main.go +++ b/main.go @@ -39,10 +39,6 @@ func main() { s := bufio.NewScanner(os.Stdin) fmt.Fprintln(os.Stderr, "reading standard input as", mode) for s.Scan() { - if err := s.Err(); err != nil { - fmt.Fprintln(os.Stderr, "reading input failed:", err) - continue // Maybe depart? - } d, err := dec(s.Bytes()) if err != nil { fmt.Fprintln(os.Stderr, "decoding input failed:", err) @@ -60,4 +56,7 @@ func main() { } fmt.Println(string(out)) } + if err := s.Err(); err != nil { + fmt.Fprintln(os.Stderr, "reading input failed:", err) + } }