From 8f74ead862c3fa3cddaf4b4b3236abef3b835602 Mon Sep 17 00:00:00 2001 From: stephen Date: Tue, 22 Jun 2010 07:30:23 -0400 Subject: [PATCH] Moved stripComments to read.go. --- conf.go | 12 ------------ read.go | 10 ++++++++++ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/conf.go b/conf.go index 963abf2..b22758a 100644 --- a/conf.go +++ b/conf.go @@ -160,18 +160,6 @@ func NewConfigFile() *ConfigFile { return c } - -func stripComments(l string) string { - // comments are preceded by space or TAB - for _, c := range []string{" ;", "\t;", " #", "\t#"} { - if i := strings.Index(l, c); i != -1 { - l = l[0:i] - } - } - return l -} - - func firstIndex(s string, delim []byte) int { for i := 0; i < len(s); i++ { for j := 0; j < len(delim); j++ { diff --git a/read.go b/read.go index b7a83e7..a731f82 100644 --- a/read.go +++ b/read.go @@ -109,3 +109,13 @@ func (c *ConfigFile) Read(reader io.Reader) (err os.Error) { } return nil } + +func stripComments(l string) string { + // comments are preceded by space or TAB + for _, c := range []string{" ;", "\t;", " #", "\t#"} { + if i := strings.Index(l, c); i != -1 { + l = l[0:i] + } + } + return l +}