Standard library / net

net.IPv4len

Number of bytes in the corresponding raw IP address representation. net.IP can also represent IPv4 in 16 bytes. Expected stdout: '4\n'.

Formal Syntax & Structure

go syntaxgo
const IPv4len = 4

Working Example

Example Snippetgo
package main
import (  "fmt"  "net")
func main() { fmt.Println(net.IPv4len) }
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