From ed9330d2f6b9e5477fcf48d42290f96dfb31afba Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Wed, 11 Sep 2019 10:05:03 +0530 Subject: [PATCH] rename Key to CtxKey Signed-off-by: Madhu Rajanna --- pkg/csi-common/utils.go | 2 +- pkg/util/log.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/csi-common/utils.go b/pkg/csi-common/utils.go index 7f1d02a76..8193e6547 100644 --- a/pkg/csi-common/utils.go +++ b/pkg/csi-common/utils.go @@ -111,7 +111,7 @@ var id uint64 func contextIDInjector(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { atomic.AddUint64(&id, 1) - ctx = context.WithValue(ctx, util.Key, id) + ctx = context.WithValue(ctx, util.CtxKey, id) return handler(ctx, req) } diff --git a/pkg/util/log.go b/pkg/util/log.go index 21d2853cc..65a105cef 100644 --- a/pkg/util/log.go +++ b/pkg/util/log.go @@ -20,12 +20,12 @@ import ( type contextKey string -// Key for context based logging -var Key = contextKey("ID") +// CtxKey for context based logging +var CtxKey = contextKey("ID") // Log helps in context based logging func Log(ctx context.Context, format string) string { - id := ctx.Value(Key) + id := ctx.Value(CtxKey) if id == nil { return format }