From 1759bec5a9f9bbd1fee8b4d1531c122a40859248 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Sat, 9 Mar 2024 22:55:42 +0300 Subject: [PATCH] finish Signed-off-by: Vasiliy Tolstov --- sync/waitgroup.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sync/waitgroup.go b/sync/waitgroup.go index e7c09add..5dbc1126 100644 --- a/sync/waitgroup.go +++ b/sync/waitgroup.go @@ -7,9 +7,9 @@ import ( ) type WaitGroup struct { - mu sync.Mutex wg *sync.WaitGroup c *atomic.Int64 + mu sync.Mutex } func WrapWaitGroup(wg *sync.WaitGroup) *WaitGroup { @@ -22,11 +22,7 @@ func WrapWaitGroup(wg *sync.WaitGroup) *WaitGroup { func NewWaitGroup() *WaitGroup { var wg sync.WaitGroup - g := &WaitGroup{ - wg: &wg, - c: &(atomic.Int64{}), - } - return g + return WrapWaitGroup(&wg) } func (g *WaitGroup) Add(n int) {