bump(github.com/ccding/go-config-reader): 02eda1a8218709cdcbd6fe2d53cd76128ac13526
This commit is contained in:
@ -31,6 +31,7 @@ func Read(filename string) (map[string]string, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return res, err
|
return res, err
|
||||||
}
|
}
|
||||||
|
defer in.Close()
|
||||||
scanner := bufio.NewScanner(in)
|
scanner := bufio.NewScanner(in)
|
||||||
line := ""
|
line := ""
|
||||||
section := ""
|
section := ""
|
||||||
@ -60,7 +61,6 @@ func Read(filename string) (map[string]string, error) {
|
|||||||
res[section+key] = value
|
res[section+key] = value
|
||||||
line = ""
|
line = ""
|
||||||
}
|
}
|
||||||
in.Close()
|
|
||||||
return res, nil
|
return res, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,4 +25,6 @@ func main() {
|
|||||||
res, err := config.Read("example.conf")
|
res, err := config.Read("example.conf")
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
fmt.Println(res)
|
fmt.Println(res)
|
||||||
|
fmt.Println(res["test.a"])
|
||||||
|
fmt.Println(res["dd"])
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user