refactor: change named types in nullables to structs

This commit is contained in:
juancwu 2026-05-05 17:38:20 +00:00
commit 52814db43d

View file

@ -5,7 +5,9 @@ import (
"encoding/json" "encoding/json"
) )
type NullTime sql.NullTime type NullTime struct {
sql.NullTime
}
func (nt NullTime) MarshalJSON() ([]byte, error) { func (nt NullTime) MarshalJSON() ([]byte, error) {
if nt.Valid { if nt.Valid {
@ -26,7 +28,9 @@ func (nt *NullTime) UnmarshalJSON(data []byte) error {
return nil return nil
} }
type NullString sql.NullString type NullString struct {
sql.NullString
}
func (ns NullString) MarshalJSON() ([]byte, error) { func (ns NullString) MarshalJSON() ([]byte, error) {
if ns.Valid { if ns.Valid {