Standard library / net

net.HardwareAddr.String()

Format hardware address bytes with colon separators. Expected stdout: '02:00:00:00:00:01\n'.

Formal Syntax & Structure

go syntaxgo
func (a HardwareAddr) String() string

Return Value

string

Operation result; check errors and validity indicators when returned.

Working Example

Example Snippetgo
package main
import (  "fmt"  "net")
func main() { fmt.Println(net.HardwareAddr{2, 0, 0, 0, 0, 1}.String()) }
func must[T any](v T, e error) T {  if e != nil {    panic(e)  }  return v}func check(e error) {  if e != nil {    panic(e)  }}
Go Reference