Standard library / net/netip
netip.Addr.Zone()
Return the scoped zone string, or empty when absent. Expected stdout: 'demo\n'.
Formal Syntax & Structure
go syntaxgo
func (ip Addr) Zone() stringReturn Value
string
Operation result; check errors and validity indicators when returned.
Working Example
Example Snippetgo
package main
import ( "fmt" "net/netip")
func main() { fmt.Println(netip.MustParseAddr("fe80::1%demo").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) }}