Yes, but the blog post makes it pretty clear that easy JSON decoding/encoding is a primary goal, and this is not friendly to that.
func (ns NullString) MarshalJSON() ([]byte, error) {
if !ns.Valid {
return []byte("null"), nil
}
return json.Marshal(ns.String)
}
It would render `user_id: null` instead of `user_id: ""` which should work, I think.