Skip to content

Commit

Permalink
handle errors around scanner.Scan()
Browse files Browse the repository at this point in the history
Signed-off-by: James Humphries <[email protected]>
  • Loading branch information
Yantrio committed Aug 28, 2024
1 parent d029f08 commit 2513b75
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion search/pg-indexer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ func main() {
}

scanner := bufio.NewScanner(body)
scanner.Scan()
if !scanner.Scan() {
log.Fatal("no data in search index")
}

header, err := readSearchHeader(scanner.Bytes())
if err != nil {
Expand Down

0 comments on commit 2513b75

Please sign in to comment.