Skip to content

Commit 1e41a3f

Browse files
authored
Merge pull request #921 from astaxie/revert-918-patch-1
Revert "defer db connection close"
2 parents b3dabd6 + d597678 commit 1e41a3f

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)