From b3f775a196231b79693ff17d854f40ef1f578127 Mon Sep 17 00:00:00 2001 From: lion Date: Wed, 7 Dec 2022 11:24:58 +0800 Subject: [PATCH] ignore empty lines --- maker/golang/xdb/util.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/maker/golang/xdb/util.go b/maker/golang/xdb/util.go index 63c3394..fa2daeb 100644 --- a/maker/golang/xdb/util.go +++ b/maker/golang/xdb/util.go @@ -53,9 +53,11 @@ func IterateSegments(handle *os.File, before func(l string), cb func(seg *Segmen scanner.Split(bufio.ScanLines) for scanner.Scan() { var l = strings.TrimSpace(strings.TrimSuffix(scanner.Text(), "\n")) + if len(l) < 1 { // ignore empty line + continue + } - // ignore the comment line - if l[0] == '#' { + if l[0] == '#' { // ignore the comment line continue }