Skip to content

Instantly share code, notes, and snippets.

View uugan's full-sized avatar

Uugan uugan

  • Ulaanbaatar, Mongolia
View GitHub Profile
@keidrun
keidrun / README.md
Last active May 20, 2024 13:42
How to marshal and unmarshal sql.Null types to JSON in golang

Answer

Use custom nullable types instead of original sql.Null types like sql.NullBool, sql.NullFloat64, sql.NullInt64 or sql.NullString.