github-vet / github-vet/rangeloop-pointer-findings
zwcui/baseMircoApi: taskservice/task/liveTask.go; 33 LoC
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- PR metrics pending
Description
Found a possible issue in [zwcui/baseMircoApi](https://www.github.com/zwcui/baseMircoApi) at [taskservice/task/liveTask.go](https://github.com/zwcui/baseMircoApi/blob/727407c592608a0b30883b9b89b93ca259952c14/taskservice/task/liveTask.go#L55-L87)
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.
>
[Click here to see the code in its original context.](https://github.com/zwcui/baseMircoApi/blob/727407c592608a0b30883b9b89b93ca259952c14/taskservice/task/liveTask.go#L55-L87)
Click here to show the 33 line(s) of Go which triggered the analyzer.
```go
for _, live := range liveList {
//streamid = urlencode(sdkappid_roomid_userid_main)
streamId := models.JTTencentCloudSDKAppID + "_" + strconv.FormatInt(live.RoomId, 10) + "_" + strconv.FormatInt(live.AuthorId, 10) + "_main"
credential := common.NewCredential(models.JTTencentCloudSecretId, models.JTTencentCloudSecretKey)
cpf := profile.NewClientProfile()
client, _ := vod.NewClient(credential, regions.Chongqing, cpf)
request := vod.NewSearchMediaRequest()
request.StreamId = &streamId
response, err := client.SearchMedia(request)
if err != nil {
util.Logger.Info("client.SearchMedia(&request) failed err:" +err.Error())
continue
}
util.Logger.Info("SearchMedia streamId=" + streamId + " response.ToJsonString()")
util.Logger.Info(response.ToJsonString())
for _, media := range response.Response.MediaInfoSet {
live.VideoFileId = *media.FileId
if media.BasicInfo != nil {
live.VideoCoverUrl = *media.BasicInfo.CoverUrl
live.VideoUrl = *media.BasicInfo.MediaUrl
}
if media.MetaData != nil {
live.VideoDuration = int(*media.MetaData.VideoDuration)
}
}
base.DBEngine.Table("live").Where("id=?", live.Id).AllCols().Update(&live)
}
```
Click here to show extra information the analyzer produced.
```
No path was found through the callgraph that could lead to a function which writes a pointer argument.
No path was found through the callgraph that could lead to a function which passes a pointer to third-party code.
root signature {Update 1} was not found in the callgraph; reference was passed directly to third-party code
```
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: 727407c592608a0b30883b9b89b93ca259952c14
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.