jinzhu / copier

Copier for golang, copy value from struct to struct and more
MIT License
5.58k stars 490 forks source link

Allow usage of pointers to generic type in Scan method for sql.Null* … #49

Closed timsolov closed 4 years ago

timsolov commented 4 years ago
type Request struct {
    Name      *string // <--- not copying properly
    Num       int // <--- not copying properly
    CreatedAt *time.Time // <--- not copying properly
    UpdatedAt sql.NullTime
}

type Model struct {
    Name      sql.NullString
    Num       sql.NullInt32
    CreatedAt sql.NullTime
    UpdatedAt sql.NullTime
}

These fields don't copies. One new line resolve this issue.