From 044c6593a25a48483ef352887373d6bb10f1ecd8 Mon Sep 17 00:00:00 2001 From: Brandon Philips Date: Wed, 7 Aug 2013 13:52:26 -0700 Subject: [PATCH] bump(github.com/ccding/go-config-reader): 02eda1a8218709cdcbd6fe2d53cd76128ac13526 --- third_party/github.com/ccding/go-config-reader/config/config.go | 2 +- third_party/github.com/ccding/go-config-reader/example.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/third_party/github.com/ccding/go-config-reader/config/config.go b/third_party/github.com/ccding/go-config-reader/config/config.go index 75a48579e..97b899ef2 100644 --- a/third_party/github.com/ccding/go-config-reader/config/config.go +++ b/third_party/github.com/ccding/go-config-reader/config/config.go @@ -31,6 +31,7 @@ func Read(filename string) (map[string]string, error) { if err != nil { return res, err } + defer in.Close() scanner := bufio.NewScanner(in) line := "" section := "" @@ -60,7 +61,6 @@ func Read(filename string) (map[string]string, error) { res[section+key] = value line = "" } - in.Close() return res, nil } diff --git a/third_party/github.com/ccding/go-config-reader/example.go b/third_party/github.com/ccding/go-config-reader/example.go index c9181abe3..da49575f2 100644 --- a/third_party/github.com/ccding/go-config-reader/example.go +++ b/third_party/github.com/ccding/go-config-reader/example.go @@ -25,4 +25,6 @@ func main() { res, err := config.Read("example.conf") fmt.Println(err) fmt.Println(res) + fmt.Println(res["test.a"]) + fmt.Println(res["dd"]) }