From a0c68ccf61fab2246b741d7b95c7756eb1e6b934 Mon Sep 17 00:00:00 2001 From: Dingjun Date: Wed, 3 Aug 2016 14:32:47 +0800 Subject: [PATCH] support comment start with '#' --- cfg.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfg.go b/cfg.go index b156eff..c368667 100644 --- a/cfg.go +++ b/cfg.go @@ -129,12 +129,12 @@ func parseFile(fn string, i *item) { line, err := r.ReadString('\n') l := strings.Trim(line, " \r\n\t") if err != nil { - if l != "" { + if l != "" && l[0] != '#' { ii[l] = 1 } break } - if l == "" { + if l == "" || l[0] == '#' { continue } ii[l] = 1