Standard library / net/http/httputil
httputil.ErrClosed
Deprecated historical sentinel for a user-closed persistent connection. Demonstrates identity only, not a triggered error path. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
var ErrClosed *http.ProtocolErrorWorking Example
Example Snippetgo
package main
import ( "errors" "fmt" "net/http/httputil")
func main() { var err error = httputil.ErrClosed; fmt.Println(errors.Is(err, httputil.ErrClosed)) }
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) }}