mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-12 19:49:32 +02:00
Modernize Go code
This commit is contained in:
@@ -69,11 +69,11 @@ func ScanFuncForSeparator(sep string) StringScannerScanFunc {
|
||||
|
||||
}
|
||||
return func(data string) (remaining_data, token string) {
|
||||
idx := strings.Index(data, sep)
|
||||
if idx < 0 {
|
||||
before, after, ok := strings.Cut(data, sep)
|
||||
if !ok {
|
||||
return "", data
|
||||
}
|
||||
return data[idx+len(sep):], data[:idx]
|
||||
return after, before
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user