ignore the comment line which start with #
This commit is contained in:
parent
d686979718
commit
83e15427a8
|
|
@ -53,6 +53,12 @@ func IterateSegments(handle *os.File, before func(l string), cb func(seg *Segmen
|
||||||
scanner.Split(bufio.ScanLines)
|
scanner.Split(bufio.ScanLines)
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
var l = strings.TrimSpace(strings.TrimSuffix(scanner.Text(), "\n"))
|
var l = strings.TrimSpace(strings.TrimSuffix(scanner.Text(), "\n"))
|
||||||
|
|
||||||
|
// ignore the comment line
|
||||||
|
if l[0] == '#' {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
if before != nil {
|
if before != nil {
|
||||||
before(l)
|
before(l)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue