*: revendor dependencies after moving to go1.12

This commit is contained in:
paulfantom 2019-06-20 13:50:30 +02:00
parent a47edfe5a9
commit 552284f174
No known key found for this signature in database
GPG key ID: 12AE0185401674E7
371 changed files with 57445 additions and 108763 deletions

View file

@ -64,6 +64,7 @@ package trace // import "golang.org/x/net/trace"
import (
"bytes"
"context"
"fmt"
"html/template"
"io"
@ -124,6 +125,18 @@ func init() {
http.HandleFunc("/debug/events", Events)
}
// NewContext returns a copy of the parent context
// and associates it with a Trace.
func NewContext(ctx context.Context, tr Trace) context.Context {
return context.WithValue(ctx, contextKey, tr)
}
// FromContext returns the Trace bound to the context, if any.
func FromContext(ctx context.Context) (tr Trace, ok bool) {
tr, ok = ctx.Value(contextKey).(Trace)
return
}
// Traces responds with traces from the program.
// The package initialization registers it in http.DefaultServeMux
// at /debug/requests.