From 429a87e83bf98d4e3a3df8a4977e03856ed30450 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Fri, 12 May 2023 11:38:43 +0300 Subject: [PATCH] [#39] ir: Use defer for wg.Done() Not important, but `exitOnErr` can alter control flow, let's be explicit. Signed-off-by: Evgenii Stratonikov --- cmd/frostfs-ir/httpcomponent.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/frostfs-ir/httpcomponent.go b/cmd/frostfs-ir/httpcomponent.go index 8f5e3753b..3a6d77d84 100644 --- a/cmd/frostfs-ir/httpcomponent.go +++ b/cmd/frostfs-ir/httpcomponent.go @@ -50,8 +50,8 @@ func (c *httpComponent) start() { log.Info(fmt.Sprintf("start %s", c.name)) wg.Add(1) go func() { + defer wg.Done() exitErr(c.srv.Serve()) - wg.Done() }() } }