Given a go struct
type Company struct {
ID int `json:\"id\"`
Abn sql.NullString `json:\"abn,string\"`
}
w
The question suggests that you want to expose your database structure as JSON (presumably REST-ish) API. Unless the project is going to have a short lifespan or the logic layer is trivial, such an approach is considered an antipattern. The internals (database structure) become coupled with the external interface (API) and may result in a high cost of making a change.
I'm attaching some reads as Google is full of tutorials on how to do the opposite:
https://lostechies.com/jimmybogard/2016/05/12/entities-arent-resources-resources-arent-representations/
https://thorben-janssen.com/dont-expose-entities-in-api/