github-vet / github-vet/rangeloop-pointer-findings
soouCc/smt: service/trace_service/trace.go; 18 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [soouCc/smt](https://www.github.com/soouCc/smt) at [service/trace_service/trace.go](https://github.com/soouCc/smt/blob/202e16b82afe96e2f026f8cb3296504c18fa49c5/service/trace_service/trace.go#L61-L78)
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 k used in defer or goroutine at line 63
[Click here to see the code in its original context.](https://github.com/soouCc/smt/blob/202e16b82afe96e2f026f8cb3296504c18fa49c5/service/trace_service/trace.go#L61-L78)
Click here to show the 18 line(s) of Go which triggered the analyzer.
```go
for k, _ := range smp.Data {
go func() {
_db := Tmap.Get(k)
_db2 := Tmap2.Get(k)
if len(_db) > 0 || len(_db2) > 0 {
dy := sortArr(_db, _db2)
soudata := ""
index := 0
for _, v := range dy {
index++
soudata += v.Data + "\n"
}
md5str := GetMD5Encode([]byte(soudata))
source_map.Add(dy[0].TraceId, md5str)
}
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: 202e16b82afe96e2f026f8cb3296504c18fa49c5
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.