github-vet / github-vet/rangeloop-pointer-findings
zwcui/baseMircoApi: messageservice/controllers/messageApi.go; 45 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 [messageservice/controllers/messageApi.go](https://github.com/zwcui/baseMircoApi/blob/727407c592608a0b30883b9b89b93ca259952c14/messageservice/controllers/messageApi.go#L1059-L1103)
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/messageservice/controllers/messageApi.go#L1059-L1103)
Click here to show the 45 line(s) of Go which triggered the analyzer.
```go
for _, fissionMember := range fissionMemberList {
var activity models.Activity
hasActivity, _ := session.Table("activity").Where("id=?", fissionMember.ActivityId).And("status=1").Get(&activity)
if hasActivity {
util.Logger.Info("hasActivity ")
var lastJoinActivity models.JoinActivity
session.Table("join_activity").Where("openid=?", fissionMember.LastOpenid).And("activity_id=?", activity.Id).And("status=1").Get(&lastJoinActivity)
//减掉订阅裂变人数
err = updateLastJoinActivityDirectNextSubscribeNum(&lastJoinActivity, -1, subscriber, activity, authInfo, session)
//减掉订阅裂变人数
err = updateLastJoinActivityAllNextSubscribeNum(&lastJoinActivity, -1, session)
//增加取消订阅裂变人数
err = updateLastJoinActivityDirectNextUnsubscribeNum(&lastJoinActivity, 1, session)
//增加取消订阅裂变人数
err = updateLastJoinActivityAllNextUnsubscribeNum(&lastJoinActivity, 1, session)
if err != nil {
session.Rollback()
util.Logger.Info("err:" + err.Error())
return err
}
//用户取消关注则助力失效(开启此功能后,当助力的好友取消关注,则推送下面的文案给上级用户)
if fissionMember.LastOpenid != "" {
var fissionInfo06 models.FissionInfo
hasFissionInfo06, _ := session.Table("fission_info").Where("activity_id=?", activity.Id).And("type=6").And("status=1").Get(&fissionInfo06)
if hasFissionInfo06 {
content := fissionInfo06.Text
content = strings.Replace(content, "[助力好友昵称]", subscriber.Nickname, -1)
content = strings.Replace(content, "[已有助力好友人数]", strconv.Itoa(lastJoinActivity.DirectNextSubscribeNum), -1)
util.RequestSendTextCustomerServiceMessage(fissionMember.LastOpenid, content, authInfo)
}
}
} else {
util.Logger.Info("!hasActivity ")
}
fissionMember.Status = 2
fissionMember.UnsubscribeTime = util.UnixOfBeijingTime()
session.Table("fission_member").Where("id=?", fissionMember.Id).Cols("status", "unsubscribe_time").Update(&fissionMember)
}
```
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.