Standard library / net/http
http.ErrHijacked
Indicates a write through a response writer whose connection has been hijacked. Example uses synthetic error classification. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
var ErrHijacked errorWorking Example
Example Snippetgo
package main
import ( "fmt" "net/http")
func main() { fmt.Println(http.ErrHijacked != nil) }
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) }}