From da1191a6c176f2bcb7348643164c784b82f13476 Mon Sep 17 00:00:00 2001 From: Roman V Date: Sun, 31 May 2020 01:22:18 +0300 Subject: [PATCH] defer stmt closest stroke --- modifying.md | 1 + 1 file changed, 1 insertion(+) diff --git a/modifying.md b/modifying.md index 487aac3..e976651 100644 --- a/modifying.md +++ b/modifying.md @@ -17,6 +17,7 @@ example shows how to insert a row and inspect metadata about the operation:
 stmt, err := db.Prepare("INSERT INTO users(name) VALUES(?)")
+defer stmt.Close()
 if err != nil {
 	log.Fatal(err)
 }