From ebfba72715b4135fb1aa9a16fce5cde9a0c77f9f Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Mon, 26 Feb 2018 10:07:18 -0800 Subject: [PATCH] client: fix "ineffassign" warning Signed-off-by: Gyuho Lee --- client/client_test.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/client/client_test.go b/client/client_test.go index 5e547a8cd..20bcf2d86 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -483,8 +483,14 @@ func (f fakeCancelContext) Done() <-chan struct{} { func (f fakeCancelContext) Err() error { return fakeCancelContextError } func (f fakeCancelContext) Value(key interface{}) interface{} { return 1 } -func withTimeout(parent context.Context, timeout time.Duration) (context.Context, context.CancelFunc) { - return parent, func() { parent = nil } +func withTimeout(parent context.Context, timeout time.Duration) ( + ctx context.Context, + cancel context.CancelFunc) { + ctx = parent + cancel = func() { + ctx = nil + } + return ctx, cancel } func TestHTTPClusterClientDoCanceledContext(t *testing.T) {