Revert "defer db connection close"

This commit is contained in:
astaxie
2017-11-26 13:33:03 +08:00
committed by GitHub
parent b3dabd68c4
commit d59767860f

View File

@@ -39,7 +39,6 @@ The following example shows how to operate on a database based on the `database/
func main() {
db, err := sql.Open("mysql", "astaxie:astaxie@/test?charset=utf8")
defer db.Close()
checkErr(err)
// insert
@@ -94,6 +93,7 @@ The following example shows how to operate on a database based on the `database/
fmt.Println(affect)
db.Close()
}