client: fix "ineffassign" warning

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
Gyuho Lee 2018-02-26 10:07:18 -08:00
parent 9c9d846959
commit ebfba72715

View File

@ -483,8 +483,14 @@ func (f fakeCancelContext) Done() <-chan struct{} {
func (f fakeCancelContext) Err() error { return fakeCancelContextError } func (f fakeCancelContext) Err() error { return fakeCancelContextError }
func (f fakeCancelContext) Value(key interface{}) interface{} { return 1 } func (f fakeCancelContext) Value(key interface{}) interface{} { return 1 }
func withTimeout(parent context.Context, timeout time.Duration) (context.Context, context.CancelFunc) { func withTimeout(parent context.Context, timeout time.Duration) (
return parent, func() { parent = nil } ctx context.Context,
cancel context.CancelFunc) {
ctx = parent
cancel = func() {
ctx = nil
}
return ctx, cancel
} }
func TestHTTPClusterClientDoCanceledContext(t *testing.T) { func TestHTTPClusterClientDoCanceledContext(t *testing.T) {