From 1abe9c600ad4b60a7ad7cca9a74cc51fd7a88b0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Ra=C4=8Dinsk=C3=BD?= Date: Mon, 30 Sep 2024 23:34:09 +0200 Subject: [PATCH] fix: empty file is correctly skipped --- parser/filehandling.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parser/filehandling.go b/parser/filehandling.go index d2f59db..dbf6fc5 100644 --- a/parser/filehandling.go +++ b/parser/filehandling.go @@ -2,6 +2,7 @@ package parser import ( "bufio" + "errors" "io" "log" "os" @@ -31,6 +32,9 @@ func GetRenpyContent(rootPath string) []string { var bom [3]byte _, err = io.ReadFull(readFile, bom[:]) if err != nil { + if errors.Is(err, io.EOF) { // skip empty file + continue + } log.Fatal(err) } if bom[0] != 0xef || bom[1] != 0xbb || bom[2] != 0xbf {