Standard library / net/url
url.InvalidHostError
Represent a character not permitted in a host. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
type InvalidHostError stringWorking Example
Example Snippetgo
package main
import ( "errors" "fmt" "net/url")
func main() { _, e := url.Parse("http://bad host/") var x url.InvalidHostError fmt.Println(errors.As(e, &x))}
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) }}