From 83e15427a80e598123358ebf2ee7a74a9bee559e Mon Sep 17 00:00:00 2001 From: lion Date: Wed, 7 Dec 2022 10:29:19 +0800 Subject: [PATCH] ignore the comment line which start with # --- maker/golang/xdb/util.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maker/golang/xdb/util.go b/maker/golang/xdb/util.go index 870c232..63c3394 100644 --- a/maker/golang/xdb/util.go +++ b/maker/golang/xdb/util.go @@ -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) }