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

41north/kompoze: cmd/kompoze/main.go; 7 LoC

Open
#16,222 0 comments 0 reactions 0 assignees View on GitHub
fresh tiny
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [41north/kompoze](https://www.github.com/41north/kompoze) at [cmd/kompoze/main.go](https://github.com/41north/kompoze/blob/a69b455e8f2e592d7e990b93893a50c639157b23/cmd/kompoze/main.go#L119-L125)

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 definition used in defer or goroutine at line 122

[Click here to see the code in its original context.](https://github.com/41north/kompoze/blob/a69b455e8f2e592d7e990b93893a50c639157b23/cmd/kompoze/main.go#L119-L125)

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

```go
for _, definition := range definitions {
wg.Add(1)
go func() {
k.Render(definition, basePath, tplDelims, forceStdOut, noOverwrite)
wg.Done()
}()
}

```

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: a69b455e8f2e592d7e990b93893a50c639157b23

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with cmd/kompoze/main.go around lines 119-125 and inspect how the range variable is used inside the goroutine. Run the project's available tests or reproduce the command behavior to confirm whether each definition is rendered correctly; done means the analyzer warning is addressed without changing intended output.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.