[#39] ir: Use defer for wg.Done()

Not important, but `exitOnErr` can alter control flow, let's be
explicit.

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-05-12 11:38:43 +03:00
parent f604d6bbdc
commit 429a87e83b

View file

@ -50,8 +50,8 @@ func (c *httpComponent) start() {
log.Info(fmt.Sprintf("start %s", c.name)) log.Info(fmt.Sprintf("start %s", c.name))
wg.Add(1) wg.Add(1)
go func() { go func() {
defer wg.Done()
exitErr(c.srv.Serve()) exitErr(c.srv.Serve())
wg.Done()
}() }()
} }
} }