Standard library / net/netip

netip.AddrPort

Comparable numeric address and uint16 port; port zero is valid as a value. Expected stdout: 'false\n'.

Formal Syntax & Structure

go syntaxgo
type AddrPort struct {}

Working Example

Example Snippetgo
package main
import (  "fmt"  "net/netip")
func main() { var v netip.AddrPort; fmt.Println(v.IsValid()) }
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