Standard library / net/http/httputil
httputil.ErrLineTooLong
Returned when chunked framing contains an excessively long line. Reject malformed input rather than retrying it as a valid message. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
var ErrLineTooLong errorWorking Example
Example Snippetgo
package main
import ( "errors" "fmt" "io" "net/http/httputil" "strings")
func main() { r := httputil.NewChunkedReader(strings.NewReader(strings.Repeat("1", 8192) + "\r\n")) _, err := io.ReadAll(r) fmt.Println(errors.Is(err, httputil.ErrLineTooLong))}
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) }}