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

wgnet/wunderdns: wunderdns/run.go; 11 LoC

Open
#15,471 0 comments 0 reactions 0 assignees View on GitHub
fresh small
Dominant language
No language data
Stars
0
Forks
0
PR merge metrics
PR metrics pending

Description

Found a possible issue in [wgnet/wunderdns](https://www.github.com/wgnet/wunderdns) at [wunderdns/run.go](https://github.com/wgnet/wunderdns/blob/a09647df51b4a2e4667bcb00efa4c337b6a70300/wunderdns/run.go#L22-L32)

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 c used in defer or goroutine at line 24

[Click here to see the code in its original context.](https://github.com/wgnet/wunderdns/blob/a09647df51b4a2e4667bcb00efa4c337b6a70300/wunderdns/run.go#L22-L32)

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

```go
for _, c := range globalConfig.AMQPConfigs {
go func() {
e := startAMQPQueue(c)
if e != nil {
checkChannel <- true
logging.Fatal("startAMQPQueue error: ", e.Error())
}
}()
logging.Info("Running amqp consumer #", i)
i++
}

```

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

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading wunderdns/run.go lines 22-32 and the surrounding AMQP consumer setup, focusing on startAMQPQueue and the reported range-loop variable warning. Check the repository's available test or validation commands, then confirm the analyzer finding is addressed without changing the intended AMQP startup behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.