github-vet / github-vet/rangeloop-pointer-findings
danmarg/mta-sts-webtester: main.go; 19 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [danmarg/mta-sts-webtester](https://www.github.com/danmarg/mta-sts-webtester) at [main.go](https://github.com/danmarg/mta-sts-webtester/blob/afc2166ca7fcbf8a68704317e7b457e7b0bbf1c1/main.go#L86-L104)
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 m used in defer or goroutine at line 89
[Click here to see the code in its original context.](https://github.com/danmarg/mta-sts-webtester/blob/afc2166ca7fcbf8a68704317e7b457e7b0bbf1c1/main.go#L86-L104)
Click here to show the 19 line(s) of Go which triggered the analyzer.
```go
for _, m := range mxs {
c := make(chan string, 1)
go func(c chan<- string) {
if e := sts.CheckMXViaSMTP(m); e != nil {
c <- fmt.Sprintf("error establishing TLS connection to %v: %v", m.Host, e)
} else {
c <- ""
}
}(c)
select {
case e := <-c:
if e != "" {
mxerrs = append(mxerrs, e)
}
case <-time.After(10 * time.Second):
mxerrs = append(mxerrs, fmt.Sprintf("timeout establishing TLS connection to %v", m.Host))
continue
}
}
```
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: afc2166ca7fcbf8a68704317e7b457e7b0bbf1c1
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.