Standard library / net

net.InvalidAddrError

String-based invalid address error. Constructed example for classification. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
type InvalidAddrError string

Working Example

Example Snippetgo
package main
import (  "fmt"  "net")
func main() { fmt.Println((net.InvalidAddrError("invalid address")).Error() != "") }
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