bump(github.com/ccding/go-config-reader): 02eda1a8218709cdcbd6fe2d53cd76128ac13526

release-0.4
Brandon Philips 2013-08-07 13:52:26 -07:00
parent b1f1af82f9
commit 044c6593a2
2 changed files with 3 additions and 1 deletions

View File

@ -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
}

View File

@ -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"])
}