Golang database/sql.Stmt.Close function example
package database/sql
Close closes the statement.
Golang database/sql.Stmt.Close function usage example
func closeResources(rows *sql.Rows, stmt *sql.Stmt) error {
var err error
if rows != nil {
err = rows.Close()
if err != nil {
return err
}
}
if stmt != nil {
err = stmt.Close() // <--- here
if err != nil {
return err
}
}
return nil
}
Reference :
Advertisement
Something interesting
Tutorials
+6.8k Golang : Muxing with Martini example
+16k Golang : Get sub string example
+17.9k Golang : Simple client server example
+11.8k Golang : GTK Input dialog box examples
+7.4k Golang : Convert source code to assembly language
+20.2k Golang : Convert seconds to human readable time format example
+12.3k Golang : Flush and close file created by os.Create and bufio.NewWriter example
+11.7k Golang : Find age or leap age from date of birth example
+7.5k Gogland : Single File versus Go Application Run Configurations
+11.9k Golang : How to parse plain email text and process email header?
+12.3k Golang : Print UTF-8 fonts on image example