github-vet / github-vet/rangeloop-pointer-findings
ChangwangChen/tgpl-code: chapter9/memo.go; 13 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [ChangwangChen/tgpl-code](https://www.github.com/ChangwangChen/tgpl-code) at [chapter9/memo.go](https://github.com/ChangwangChen/tgpl-code/blob/bafb2aee8ff537ef3d5d4068db7fc06b9ce6e9b7/chapter9/memo.go#L58-L70)
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 url1 used in defer or goroutine at line 62
[Click here to see the code in its original context.](https://github.com/ChangwangChen/tgpl-code/blob/bafb2aee8ff537ef3d5d4068db7fc06b9ce6e9b7/chapter9/memo.go#L58-L70)
Click here to show the 13 line(s) of Go which triggered the analyzer.
```go
for _, url1 := range urls {
n2.Add(1)
go func(url string) {
start := time.Now()
value, err := mem2.Get(url1)
if err != nil {
log.Print(err)
}
fmt.Printf("%s, %s, %d\n",
url, time.Since(start), len(value.([]byte)))
n2.Done()
}(url1)
}
```
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: bafb2aee8ff537ef3d5d4068db7fc06b9ce6e9b7
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.