type clientEventContextKey … // ContextClientTrace returns the [ClientTrace] associated with the // provided context. If none, it returns nil. func ContextClientTrace(ctx context.Context) *ClientTrace { … } // WithClientTrace returns a new context based on the provided parent // ctx. HTTP client requests made with the returned context will use // the provided trace hooks, in addition to any previous hooks // registered with ctx. Any hooks defined in the provided trace will // be called first. func WithClientTrace(ctx context.Context, trace *ClientTrace) context.Context { … } type ClientTrace … type WroteRequestInfo … // compose modifies t such that it respects the previously-registered hooks in old, // subject to the composition policy requested in t.Compose. func (t *ClientTrace) compose(old *ClientTrace) { … } type DNSStartInfo … type DNSDoneInfo … func (t *ClientTrace) hasNetHooks() bool { … } type GotConnInfo …