Standard library / net
net.IPAddr
IP address with optional scoped IPv6 zone. Expected stdout: 'demo\n'.
Formal Syntax & Structure
go syntaxgo
type IPAddr struct { IP IP Zone string}Working Example
Example Snippetgo
package main
import ( "fmt" "net")
func main() { v := net.IPAddr{IP: net.ParseIP("fe80::1"), Zone: "demo"}; fmt.Println(v.Zone) }
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) }}