mirror of
https://github.com/lionsoul2014/ip2region.git
synced 2025-12-08 19:25:22 +00:00
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)
|
||||
for scanner.Scan() {
|
||||
var l = strings.TrimSpace(strings.TrimSuffix(scanner.Text(), "\n"))
|
||||
|
||||
// ignore the comment line
|
||||
if l[0] == '#' {
|
||||
continue
|
||||
}
|
||||
|
||||
if before != nil {
|
||||
before(l)
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user