tx.go
func TraceRequest(ctx context.Context, name string, req *http.Request) (context.Context, *Trace) {
	tx := NewRequestTx(name, req.URL.String())
	ctx = WithTx(ctx, tx)
	err := tx.Start()

	return ctx, &Trace{
		err: err,
		done: func() error {
			return tx.End()
		},
	}
}
func TraceRequest(ctx context.Context, name string, req *http.Request) (context.Context, *Trace) {
	tx := NewRequestTx(name, req.URL.String())
	ctx = WithTx(ctx, tx)
	err := tx.Start()

	return ctx, &Trace{
		err: err,
		done: func() error {
			return tx.End()
		},
	}
}
func TraceRequest ( ctx context . Context , name string , req * http . Request ) ( context . Context , * Trace ) { tx := NewRequestTx ( name , req . URL . String ( ) ) ctx = WithTx ( ctx , tx ) err := tx . Start ( ) return ctx , & Trace { err : err , done : func ( ) error { return tx . End ( ) } , } }
// TraceReqest traces an http request. It returns a new context with the transaction
// included in it, and a trace object.
//
// Usage:
//
//     ctx, t := TraceRequest(ctx, name, req)
//     defer t.Done()
TraceReqest traces an http request . It returns a new context with the transaction included in it and a trace object . Usage : ctx t : = TraceRequest ( ctx name req ) defer t . Done ()