Standard library / net/http/httptrace

httptrace.WroteRequestInfo

Reports Err from an attempt to write the request and body. A retry can trigger multiple callbacks. Success does not mean that the server accepted the request. The sample uses synthetic event data. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
type WroteRequestInfo struct {  Err error}

Working Example

Example Snippetgo
package main
import (  "errors"  "fmt"  "io"  "net/http/httptrace")
func main() {  info := httptrace.WroteRequestInfo{Err: io.ErrUnexpectedEOF}  fmt.Println(errors.Is(info.Err, io.ErrUnexpectedEOF))}
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