github-vet / github-vet/rangeloop-pointer-findings
Collapsars/w3s.com.cn_go: src/w3s.com.cn/main/app_hander_keyword.go; 41 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [Collapsars/w3s.com.cn_go](https://www.github.com/Collapsars/w3s.com.cn_go) at [src/w3s.com.cn/main/app_hander_keyword.go](https://github.com/Collapsars/w3s.com.cn_go/blob/a0482b8a289a22343045ab6a6c64cef88e7b1ad0/src/w3s.com.cn/main/app_hander_keyword.go#L43-L83)
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.
> function call which takes a reference to value at line 78 may start a goroutine
[Click here to see the code in its original context.](https://github.com/Collapsars/w3s.com.cn_go/blob/a0482b8a289a22343045ab6a6c64cef88e7b1ad0/src/w3s.com.cn/main/app_hander_keyword.go#L43-L83)
Click here to show the 41 line(s) of Go which triggered the analyzer.
```go
for _,value := range articles {
//fmt.Println(value.Type)
doc , err := goquery.NewDocumentFromReader(strings.NewReader(value.Content))
utils.CheckErr(err)
r, _ := regexp.Compile("菜鸟教程")
rr, _ := regexp.Compile("www.runoob.com")
rrr, _ := regexp.Compile("(runoob.com)")
src , _ := doc.Html()
//菜鸟教程 - >www.w3s.com.cn
//www.runoob.com - >www.w3s.com.cn
src = r.ReplaceAllString(src,"www.w3s.com.cn")
src = rr.ReplaceAllString(src,"www.w3s.com.cn")
src = rrr.ReplaceAllString(src,"")
//fmt.Println(src)
//if r.MatchString(doc.Text()) {
// fmt.Println("true")
//}
//article := Article{};
//article.Id = value.Id
value.Content = src
//Content,err := doc.Html()
//fmt.Println(value.Content)
//fmt.Println(value.Id)
///fmt.Println(time.Now().UnixNano())
db.Save(&value)
count ++
}
```
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: a0482b8a289a22343045ab6a6c64cef88e7b1ad0
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.