I'm implementing a Gorm model to access a table in MySQL.
It is something like this:
import (
"time"
)
type MyModel struct {
// ...some attributes...
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time
}
I am wondering if it is clear enough to follow Gorm conventions about using a pointer to time.Time
to point (;)) out this attribute could be nil
, or it is better to use database/sql/NullTime.
Do you think of any other benefit to use NullTime apart from readability?