ignore empty lines

This commit is contained in:
lion 2022-12-07 11:24:58 +08:00
parent 83e15427a8
commit b3f775a196

View File

@ -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
}