Skip to content

Instantly share code, notes, and snippets.

View timbaileyjones's full-sized avatar
🏠
Working from home

Tim Bailey-Jones timbaileyjones

🏠
Working from home
View GitHub Profile
@timbaileyjones
timbaileyjones / README.md
Created January 3, 2024 03:10 — forked from keidrun/README.md
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.