こんなエラーが出たら
sql: Scan error on column index x, name "updated_at": unsupported Scan, storing driver.Value type <nil> into type *time.Time
null パッケージを使う
import (
"gopkg.in/guregu/null.v3"
"time"
)
type Hoge struct {
Id int64
Hoge string
CreatedAt time.Time
UpdatedAt null.Time
DeletedAt null.Time
}
代入は、キャストして
Hoge.UpdatedAt = null.TimeFrom(time.Now())