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}
...
}
Code in file macaddr.go