Golang database/sql.NullInt64 type examples
package database/sql
NullInt64 represents an int64 that may be null. NullInt64 implements the Scanner interface so it can be used as a scan destination, similar to NullString.
Golang database/sql.NullInt64 type usage examples
Example 1:
var ni64 = sql.NullInt64{Valid: true}
Example 2:
// NullInt64
var ni sql.NullInt64
// Invalid
if err = nullStmt.QueryRow().Scan(&ni); err != nil {
dbt.Fatal(err)
}
if ni.Valid {
dbt.Error("Valid NullInt64 which should be invalid")
}
References :
https://github.com/go-sql-driver/mysql/blob/master/driver_test.go
Advertisement
Something interesting
Tutorials
+22.8k Golang : untar or extract tar ball archive example
+7.4k Golang : Individual and total number of words counter example
+5.3k Javascript : Change page title to get viewer attention
+19.3k Golang : Calculate entire request body length during run time
+12.7k Android Studio : Highlight ImageButton when pressed on example
+16.9k Golang : How to generate QR codes?
+23.5k Golang : Read a file into an array or slice example
+13.2k Golang : Skip blank/empty lines in CSV file and trim whitespaces example
+5.6k Javascript : How to refresh page with JQuery ?
+7.9k Javascript : How to check a browser's Do Not Track status?
+21.2k Golang : Convert(cast) string to rune and back to string example
+6.3k Golang : Test input string for unicode example