The MrAndreID/GoNull
package is a collection of functions in the go language for handle null when json encode and json decode with database/sql
package.
To use The MrAndreID/GoNull
package, you must follow the steps below:
go get -u github.com/MrAndreID/gonull
To use The MrAndreID/GoNull
package, you must combine it with The database/sql
package.
import "database/sql"
name := gonull.NullString{sql.NullString{"Andrea Adam", true}}
import "database/sql"
row := gonull.NullInt32{sql.NullInt32{1, true}}
import "database/sql"
row := gonull.NullInt64{sql.NullInt64{int64(1), true}}
import "database/sql"
active := gonull.NullBool{sql.NullBool{true, true}}
import (
"time"
"database/sql"
)
date, _ := time.Parse("2006-01-02 15:04:05", time.Now().Local().Format("2006-01-02 15:04:05"))
createdAt = gonull.NullTime{sql.NullTime{date, true}}
I use SemVer for versioning. For the versions available, see the tags on this repository.
Andrea Adam - MrAndreID
MIT licensed. See the LICENSE file for details.
Documentation for Go Language can be found on the Go Language website.
Documentation can be found on https://go.dev/.