1
0
mirror of https://github.com/zu1k/nali.git synced 2025-01-22 21:29:02 +08:00

fix: annotation

This commit is contained in:
mzz2017 2022-08-14 23:38:36 +08:00
parent 24cdbcfe44
commit eaeae3d7a7

View File

@ -10,9 +10,9 @@ func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error) {
return 0, nil, nil return 0, nil, nil
} }
if i, j := bytes.IndexByte(data, '\r'), bytes.IndexByte(data, '\n'); i >= 0 || j >= 0 { if i, j := bytes.IndexByte(data, '\r'), bytes.IndexByte(data, '\n'); i >= 0 || j >= 0 {
// case 1: TOKEN\r\nTOKEN
if i >= 0 && j >= 0 { if i >= 0 && j >= 0 {
if i+1 == j { if i+1 == j {
// case 1: TOKEN\r\nTOKEN
return i + 2, data[:i+2], nil return i + 2, data[:i+2], nil
} }
if i < j { if i < j {