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
+36.3k Golang : How to split or chunking a file to smaller pieces?
+6k Fontello : How to load and use fonts?
+10.2k Golang : Use regular expression to get all upper case or lower case characters example
+8.3k Golang : Count leading or ending zeros(any item of interest) example
+6.7k Golang : Skip or discard items of non-interest when iterating example
+30.8k Golang : Download file example
+14.4k Golang : Recombine chunked files example
+9k Golang : Build and compile multiple source files
+21.7k Golang : Setting up/configure AWS credentials with official aws-sdk-go
+11.3k Golang : How to flush a channel before the end of program?
+24k Golang : Find biggest/largest number in array
+5.9k Golang : Shuffle array of list