-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix offBy1 errors #17606
Fix offBy1 errors #17606
Conversation
- Partially resolves go-gitea#17596 - Resolve errors from go-critic `offBy1: Index() can return -1; maybe you wanted to do Index()+1`.
Codecov Report
@@ Coverage Diff @@
## main #17606 +/- ##
=======================================
Coverage ? 45.50%
=======================================
Files ? 795
Lines ? 88863
Branches ? 0
=======================================
Hits ? 40441
Misses ? 41906
Partials ? 6516
Continue to review full report at Codecov.
|
Co-authored-by: delvh <dev.lh@web.de>
🚀 |
* Fix offBy1 errors - Partially resolves go-gitea#17596 - Resolve errors from go-critic `offBy1: Index() can return -1; maybe you wanted to do Index()+1`. * Match golang spec * Remove comments * Update migrations.go * Apply suggestions from code review Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
offBy1: Index() can return -1; maybe you wanted to do Index()+1
.Note: for
firstHashtagIndex
I haven't returned a error, as I do think it's possible that legitimate docs don't have#
.But for
endColumnsIndex
I have returned a error, as it do seems to be necessary.