]> source.dussan.org Git - gitea.git/commit
Fix offBy1 errors (#17606)
authorGusted <williamzijl7@hotmail.com>
Sun, 14 Nov 2021 08:11:49 +0000 (08:11 +0000)
committerGitHub <noreply@github.com>
Sun, 14 Nov 2021 08:11:49 +0000 (10:11 +0200)
commitd2163df6a0d6b9663a65438c1d960ea4ab5c2df0
tree821ab5acde9a8f382db637b83f0b3ae1c1f3c6f5
parent8eddb755086f84c8c1168447391ac04a3a6b7702
Fix offBy1 errors (#17606)

* Fix offBy1 errors

- Partially resolves #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>
cmd/docs.go
models/migrations/migrations.go