1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-14 22:47:21 +00:00

Upgrade xorm to v1.1.0 (#15869)

This commit is contained in:
Lunny Xiao
2021-05-15 03:17:06 +08:00
committed by GitHub
parent e2f39c2b64
commit f6be429781
55 changed files with 1309 additions and 438 deletions

View File

@ -8,10 +8,12 @@ import (
"strings"
)
// IndexNoCase index a string in a string with no care of capitalize
func IndexNoCase(s, sep string) int {
return strings.Index(strings.ToLower(s), strings.ToLower(sep))
}
// SplitNoCase split a string by a seperator with no care of capitalize
func SplitNoCase(s, sep string) []string {
idx := IndexNoCase(s, sep)
if idx < 0 {
@ -20,6 +22,7 @@ func SplitNoCase(s, sep string) []string {
return strings.Split(s, s[idx:idx+len(sep)])
}
// SplitNNoCase split n by a seperator with no care of capitalize
func SplitNNoCase(s, sep string, n int) []string {
idx := IndexNoCase(s, sep)
if idx < 0 {