-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Description
Hello, and thanks for the linter.
sqlclosecheck complains that rows.Close() should use defer. Can you explain why this is? For example, I don't see a difference between:
rows := db.Query("SELECT username FROM users")
for rows.Next() {
// Do something
}
rows.Close()
return
and
rows := db.Query("SELECT username FROM users")
for rows.Next() {
// Do something
}
defer rows.Close()
return
Putting defer here just seems confusing / a mistake / superfluous.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed