-
Notifications
You must be signed in to change notification settings - Fork 110
Some vet tools fixes #688
Some vet tools fixes #688
Conversation
auth/common_test.go
Outdated
| db, err := dsql.Open("mysql", connString(c.user, "")) | ||
| req.NoError(err) | ||
| _, err = db.Query(c.query) | ||
| db, e := dsql.Open("mysql", connString(c.user, "")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why e?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To shut up go vet about shadowing err in the enclosing context.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you can do
var db *sql.DB
db, err = dsql.Open(yada yada)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var db *dsql.DB actually. It's one line more, but ok, err is certainly more easy to human-parse than just e.
Signed-off-by: Juanjo Alvarez <juanjo@sourced.tech>
ajnavarro
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juanjux could you review again all the error variable names?
Signed-off-by: Juanjo Alvarez <juanjo@sourced.tech>
|
@ajnavarro check the last commit (I'll rebase it later), I've renamed most of the |
Fixes #686 except for a false positive (bug?) in the nilness tool.