github-vet / github-vet/rangeloop-pointer-findings

dev-86/awless: sync/sync.go; 13 LoC

Open
#14,398 0 comments 1 reaction 0 assignees View on GitHub
small
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [dev-86/awless](https://www.github.com/dev-86/awless) at [sync/sync.go](https://github.com/dev-86/awless/blob/8909030babf101749ab0014c35960cdbb8e4c5b0/sync/sync.go#L88-L100)

Below is the message reported by the analyzer for this snippet of code. Beware that the analyzer only reports the first issue it finds, so please do not limit your consideration to the contents of the below message.

> range-loop variable service used in defer or goroutine at line 98

[Click here to see the code in its original context.](https://github.com/dev-86/awless/blob/8909030babf101749ab0014c35960cdbb8e4c5b0/sync/sync.go#L88-L100)

Click here to show the 13 line(s) of Go which triggered the analyzer.

```go
for _, service := range services {
if service.IsSyncDisabled() {
s.logger.Verbosef("sync: *disabled* for service %s", service.Name())
continue
}
workers.Add(1)
go func(srv cloud.Service) {
defer workers.Done()
start := time.Now()
g, err := srv.Fetch(context.Background())
resultc <- &result{service: srv, gph: g, start: start, err: err}
}(service)
}

```

Leave a reaction on this issue to contribute to the project by classifying this instance as a **Bug** :-1:, **Mitigated** :+1:, or **Desirable Behavior** :rocket:
See the descriptions of the classifications [here](https://github.com/github-vet/rangeclosure-findings#how-can-i-help) for more information.

commit ID: 8909030babf101749ab0014c35960cdbb8e4c5b0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.