Golang News http://golangnews.com Jobs, Code, Videos and News for Go hackers - everything about the go programming language Wed, 11 Oct 2017 17:36:00 +0000 Working effectively with database nulls #data <p>This post covers how to marshall null values from a database into a <a href="http://golang.org" target="_blank">Go</a> struct type and how to save nulls back to the database. I’ll cover the standard library’s <a href="http://golang.org/pkg/database/sql/#NullString" target="_blank">sql.NullString</a>, NullInt64, NullFloat64, etc types — which I’ll refer to as sql.NullXYZ when indicating the collection of types and not a specific Null type — important methods on those types, telltale errors, and some helpers for working with values coming from form posts.</p> 4 points posted by gopher https://marcesher.com/2014/10/13/go-working-effectively-with-database-nulls 2785 Wed, 11 Oct 2017 10:31:00 +0000