Skip to content

数据库timestamp字段为null时,读取出错 #747

Closed
@wuzhenwen0627

Description

数据库表中的字段设置为Default null,在查询数据时,报以下错误:
sql: Scan error on column index 8, name "update_at": unsupported Scan, storing driver.Value type into type *time.Time

解决办法:
1、修改字段属性,填充默认值;
2、go中数据结构不使用time.Time,改用NullTime,不会报错。

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions