Skip to content

Commit d597678

Browse files
authored
Revert "defer db connection close"
1 parent b3dabd6 commit d597678

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

en/05.2.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ The following example shows how to operate on a database based on the `database/
3939

4040
func main() {
4141
db, err := sql.Open("mysql", "astaxie:astaxie@/test?charset=utf8")
42-
defer db.Close()
4342
checkErr(err)
4443

4544
// insert
@@ -94,6 +93,7 @@ The following example shows how to operate on a database based on the `database/
9493

9594
fmt.Println(affect)
9695

96+
db.Close()
9797

9898
}
9999

0 commit comments

Comments
 (0)