On the problem of infinite for loops #4744
-
I would like to ask a question. Currently, there is a problem with infinite continuity in the code under the business. I would like to ask if there is a Linter who can solve this problem. If you can answer this question, I would greatly appreciate it. for {
req.PageIndex = &pageIndex
curResp, err := ad_audit_hammurabi_core_i18n.RawCall.SearchWhiteListData(ctx, req)
if err != nil {
logs.CtxError(ctx, "error")
continue
}
data = append(data, curResp.Datas...)
if curResp.Count == nil || int64((*req.PageSize)*(*req.PageIndex)) > *curResp.Count{
break
}
pageIndex++
} |
Beta Was this translation helpful? Give feedback.
Answered by
ldez
May 23, 2024
Replies: 1 comment 2 replies
-
No, because it's impossible to evaluate statically this kind of problem. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
ldez
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No, because it's impossible to evaluate statically this kind of problem.
Your snippet is an example: there is a break but it's impossible to know statically if the break condition is possible or not.