API Metrics : send context type, not context name

Signed-off-by: Guillaume Tardif <guillaume.tardif@docker.com>
This commit is contained in:
Guillaume Tardif 2020-09-25 16:26:48 +02:00
parent fbe505f27f
commit 7807fb33cc
6 changed files with 45 additions and 23 deletions

View file

@ -31,8 +31,8 @@ import (
type clientKey struct{}
// WithClient adds the client to the context
func WithClient(ctx context.Context, c *client.Client) (context.Context, error) {
return context.WithValue(ctx, clientKey{}, c), nil
func WithClient(ctx context.Context, c *client.Client) context.Context {
return context.WithValue(ctx, clientKey{}, c)
}
// Client returns the client from the context