Fix goreportcard issues (#271)
* Fixed misspell * Fixed ineffassign `user` and `password` always got overwritten `orderedVals` was initialized with an empty array but always got overwritten by either `sortByLines()` or `sortAlphabetical` `err` was assigned a `nil` value that was either overwritten or unused anyways * Fix comment for DeletePath The comment assumed the method was named Delete, i guess a rename happened at some point * Update doc_test.go
This commit is contained in:
committed by
Thomas Pelletier
parent
d95bfe020e
commit
51edd0ca49
+5
-4
@@ -16,13 +16,14 @@ func Example_tree() {
|
||||
fmt.Println("Error ", err.Error())
|
||||
} else {
|
||||
// retrieve data directly
|
||||
user := config.Get("postgres.user").(string)
|
||||
password := config.Get("postgres.password").(string)
|
||||
directUser := config.Get("postgres.user").(string)
|
||||
directPassword := config.Get("postgres.password").(string)
|
||||
fmt.Println("User is", directUser, " and password is", directPassword)
|
||||
|
||||
// or using an intermediate object
|
||||
configTree := config.Get("postgres").(*toml.Tree)
|
||||
user = configTree.Get("user").(string)
|
||||
password = configTree.Get("password").(string)
|
||||
user := configTree.Get("user").(string)
|
||||
password := configTree.Get("password").(string)
|
||||
fmt.Println("User is", user, " and password is", password)
|
||||
|
||||
// show where elements are in the file
|
||||
|
||||
Reference in New Issue
Block a user