mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
bump(github.com/ccding/go-config-reader): 02eda1a8218709cdcbd6fe2d53cd76128ac13526
This commit is contained in:
parent
b1f1af82f9
commit
044c6593a2
@ -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
|
||||
}
|
||||
|
||||
|
@ -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"])
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user