only print word if no error

This commit is contained in:
2025-09-13 13:36:04 -07:00
parent 401fb1c591
commit 176a140819

View File

@@ -57,9 +57,9 @@ func main() {
word, err := findWord(bitmap) word, err := findWord(bitmap)
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "%s: %s\n", os.Args[0], err) fmt.Fprintf(os.Stderr, "%s: %s\n", os.Args[0], err)
} else {
fmt.Println(word)
} }
fmt.Println(word)
} }
if err := scanner.Err(); err != nil { if err := scanner.Err(); err != nil {