Skip to content

Commit

Permalink
make sonarcloud happy
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Richter <[email protected]>
  • Loading branch information
dragonchaser committed Oct 14, 2024
1 parent 6064386 commit 5627854
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ocis-pkg/handlers/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,9 @@ func (h *CheckHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
g.SetLimit(h.conf.limit)

for name, check := range h.conf.checks {
checker := check
g.Go(func() error { // https://go.dev/blog/loopvar-preview per iteration scope since go 1.22
if err := check(ctx); err != nil { // since go 1.22 for loops have a per-iteration scope instead of per-loop scope, no need to pin the check...
if err := checker(ctx); err != nil { // since go 1.22 for loops have a per-iteration scope instead of per-loop scope, no need to pin the check...
return fmt.Errorf("'%s': %w", name, err)
}

Expand Down

0 comments on commit 5627854

Please sign in to comment.