package main import ( "fmt" "net" ) func main() { addr := net.HardwareAddr{0x00, 0x11, 0x22, 0x33, 0x44, 0x55} fmt.Println(addr.String()) // prints "00:11:22:33:44:55" }
package main import ( "fmt" "net" ) func main() { addr, _ := net.ParseMAC("00:11:22:33:44:55") fmt.Println(addr.String()) // prints "00:11:22:33:44:55" }This code uses the `ParseMAC` function to create a `HardwareAddr` value from a string, and then prints its string representation. Both of these examples use functions and types provided by the `net` package in Go.