FromContext retrieves the telemetry client from context
(ctx context.Context)
| 19 | |
| 20 | // FromContext retrieves the telemetry client from context |
| 21 | func FromContext(ctx context.Context) *Client { |
| 22 | if client, ok := ctx.Value(clientContextKey).(*Client); ok { |
| 23 | return client |
| 24 | } |
| 25 | return nil |
| 26 | } |
| 27 | |
| 28 | func RecordError(ctx context.Context, err string) { |
| 29 | if client := FromContext(ctx); client != nil { |
no test coverage detected