Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

数据库的值是null的时候 只获取某列会报错 #889

@w3eee

Description

@w3eee

写法
var name string has, err := engine.Where("id = ?", id).Cols("name").Get(&name) 数据库的name值是NULL
报错信息如下:
sql: Scan error on column index 0: unsupported Scan, storing driver.Value type <nil> into type *string

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions