mirror of
https://github.com/go-gitea/gitea.git
synced 2026-09-16 01:43:24 +09:00
chore: fix various problems (#39298)
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
package util
|
||||
|
||||
import (
|
||||
"iter"
|
||||
"strings"
|
||||
"unsafe"
|
||||
)
|
||||
@@ -131,3 +132,10 @@ func AsciiEqualFold(s, t string) bool {
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
func StringSplitSeq[T, S ~string](s T, sep S) iter.Seq[T] {
|
||||
f := strings.SplitSeq(string(s), string(sep))
|
||||
return func(yield func(T) bool) {
|
||||
f(func(v string) bool { return yield(T(v)) })
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user