From 4b766c85ebc208e2b6a32fc6095e509b35471622 Mon Sep 17 00:00:00 2001 From: D3Hunter Date: Wed, 1 Nov 2023 18:18:10 +0800 Subject: [PATCH] fix comments --- br/pkg/lightning/backend/local/localhelper_test.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/br/pkg/lightning/backend/local/localhelper_test.go b/br/pkg/lightning/backend/local/localhelper_test.go index 47499fafe311d..0ee5f9b9a6fca 100644 --- a/br/pkg/lightning/backend/local/localhelper_test.go +++ b/br/pkg/lightning/backend/local/localhelper_test.go @@ -253,10 +253,8 @@ func (c *testSplitClient) ScanRegions(ctx context.Context, key, endKey []byte, l c.mu.Lock() defer c.mu.Unlock() - select { - case <-ctx.Done(): - return nil, ctx.Err() - default: + if err := ctx.Err(); err != nil { + return nil, err } if c.hook != nil {