From 2a108ad35e3050ea4f3ea739ae9185c9e51a5899 Mon Sep 17 00:00:00 2001 From: CMGS Date: Wed, 11 Oct 2023 03:00:24 +0800 Subject: [PATCH] temp disable depguard --- .golangci.yml | 2 +- cmd/workload/sendlarge.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 695659a..caae0ea 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -23,7 +23,7 @@ linters: disable-all: true enable: - bodyclose - - depguard + # - depguard - dogsled - gochecknoinits - goconst diff --git a/cmd/workload/sendlarge.go b/cmd/workload/sendlarge.go index 5dfde13..93b6367 100644 --- a/cmd/workload/sendlarge.go +++ b/cmd/workload/sendlarge.go @@ -33,6 +33,7 @@ func (o *sendLargeWorkloadsOptions) run(ctx context.Context) error { wg := sync.WaitGroup{} wg.Add(1) + defer wg.Wait() go func() { defer wg.Done() for { @@ -60,9 +61,7 @@ func (o *sendLargeWorkloadsOptions) run(ctx context.Context) error { return err } } - stream.CloseSend() - wg.Wait() - return nil + return stream.CloseSend() } func (o *sendLargeWorkloadsOptions) toSendLargeFileChunks() []*corepb.FileOptions {