jackc / pgtype

MIT License
299 stars 111 forks source link

Not Support for nil macaddr #200

Open rogerdwan opened 1 year ago

rogerdwan commented 1 year ago

Code in file macaddr.go

switch value := src.(type) {
    case net.HardwareAddr:
// need to check if the len(value) is 0, otherwise, it want be able to insert null value for type macaddr
        addr := make(net.HardwareAddr, len(value))
        copy(addr, value)
        *dst = Macaddr{Addr: addr, Status: Present}
    case string:
        addr, err := net.ParseMAC(value)
        if err != nil {
            return err
        }
        *dst = Macaddr{Addr: addr, Status: Present}
...
}
selvakumarjawahar commented 1 year ago

I am facing the same issue. Is there a fix for this, or I can create a PR for this