Skip to content

Conversation

alingse
Copy link

@alingse alingse commented Dec 15, 2024

errRet 已经在前面检查了,所以这里一定是 nil,这样直接return 肯定会导致for 循环没执行完,所以这里的本意我认为应该返回 err

I have an idea to detect code that returns a non-relevant nilness error bug. I checked the top 1000 GitHub Go repositories and found this, all result listed in alingse/sundrylint#4

Signed-off-by: alingse <alingse@foxmail.com>
@alingse
Copy link
Author

alingse commented Dec 27, 2024

@gongna-au need help

@gongna-au
Copy link
Collaborator

感谢您提交的这个 PR!帮助我们发现了多语句执行的潜在问题🙋)等测试通过,此PR将被Merge。

errRet 已经在前面检查了,所以这里一定是 nil,这样直接return 肯定会导致for 循环没执行完,所以这里的本意我认为应该返回 err

I have an idea to detect code that returns a non-relevant nilness error bug. I checked the top 1000 GitHub Go repositories and found this, all result listed in alingse/sundrylint#4

@gongna-au gongna-au merged commit fb0925b into XiaoMi:master Dec 30, 2024
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants