Standard library / net/netip

netip.Prefix

Address plus prefix length; host bits may remain until Masked is called. Expected stdout: 'false\n'.

Formal Syntax & Structure

go syntaxgo
type Prefix struct {}

Working Example

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