From 4c958ef739e982aa7108791d7afe04b76e71aa96 Mon Sep 17 00:00:00 2001 From: Oleksandr Redko Date: Mon, 11 Nov 2024 20:48:34 +0200 Subject: [PATCH] refactor: remove redundant defer --- lint/linter.go | 2 +- lint/package.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lint/linter.go b/lint/linter.go index 2bd8355b7..b42b397b2 100644 --- a/lint/linter.go +++ b/lint/linter.go @@ -109,7 +109,7 @@ func (l *Linter) Lint(packages [][]string, ruleSet []Rule, config Config) (<-cha fmt.Fprintln(os.Stderr, err) os.Exit(1) } - defer wg.Done() + wg.Done() }(packages[n], perPkgVersions[n]) } diff --git a/lint/package.go b/lint/package.go index 2ab035f16..4a633f35a 100644 --- a/lint/package.go +++ b/lint/package.go @@ -189,7 +189,7 @@ func (p *Package) lint(rules []Rule, config Config, failures chan Failure) { wg.Add(1) go (func(file *File) { file.lint(rules, config, failures) - defer wg.Done() + wg.Done() })(file) } wg.Wait()