const hexDigit … type HardwareAddr … func (a HardwareAddr) String() string { … } // ParseMAC parses s as an IEEE 802 MAC-48, EUI-48, EUI-64, or a 20-octet // IP over InfiniBand link-layer address using one of the following formats: // // 00:00:5e:00:53:01 // 02:00:5e:10:00:00:00:01 // 00:00:00:00:fe:80:00:00:00:00:00:00:02:00:5e:10:00:00:00:01 // 00-00-5e-00-53-01 // 02-00-5e-10-00-00-00-01 // 00-00-00-00-fe-80-00-00-00-00-00-00-02-00-5e-10-00-00-00-01 // 0000.5e00.5301 // 0200.5e10.0000.0001 // 0000.0000.fe80.0000.0000.0000.0200.5e10.0000.0001 func ParseMAC(s string) (hw HardwareAddr, err error) { … }