pgtype icon indicating copy to clipboard operation
pgtype copied to clipboard

Not Support for nil macaddr

Open rogerdwan opened this issue 3 years ago • 1 comments

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}
...
}

rogerdwan avatar Mar 06 '23 08:03 rogerdwan

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

selvakumarjawahar avatar Jun 23 '23 05:06 selvakumarjawahar