diff --git a/consts.go b/consts.go index a9c9292..0e4aeda 100644 --- a/consts.go +++ b/consts.go @@ -1,16 +1,16 @@ package eol const ( - lf = '\u000A' - cr = '\u000D' - nl = '\u0085' - ls = '\u2028' + lf = '\u000A' + cr = '\u000D' + nel = '\u0085' + ls = '\u2028' ) const ( - LF = string(lf) - CR = string(cr) + LF = string(lf) + CR = string(cr) CRLF = CR+LF - NL = string(nl) - LS = string(ls) + NEL = string(nel) + LS = string(ls) ) diff --git a/readeol.go b/readeol.go index 9228373..d50f51c 100644 --- a/readeol.go +++ b/readeol.go @@ -8,11 +8,11 @@ import ( // // The end-of-line sequences it supports are: // -// line-feed (LF) (U+000A) ('\n') -// carriage-return (CR) (U+000D) ('\r') +// line-feed (LF) (U+000A) ('\n') +// carriage-return (CR) (U+000D) ('\r') // carriage-return, line-feed ("\r\n") -// new-line (NL) (U+0085) -// line-separator (LS) (U+2028) +// next-line (NEL) (U+0085) +// line-separator (LS) (U+2028) // // If successful, ReadEOL return the end-of-line sequence and the number-of-bytes read. func ReadEOL(runescanner io.RuneScanner) (endofline string, size int, err error) { @@ -37,8 +37,8 @@ func ReadEOL(runescanner io.RuneScanner) (endofline string, size int, err error) return LF, size0, nil case cr: // Nothing here. - case nl: - return NL, size0, nil + case nel: + return NEL, size0, nil case ls: return LS, size0, nil default: diff --git a/readeol_test.go b/readeol_test.go index 67bdd2f..e874550 100644 --- a/readeol_test.go +++ b/readeol_test.go @@ -35,7 +35,7 @@ func TestReadEOL(t *testing.T) { }, { Value: "\u0085", - ExpectedEOL: eol.NL, + ExpectedEOL: eol.NEL, ExpectedSize: 2, }, { @@ -63,7 +63,7 @@ func TestReadEOL(t *testing.T) { }, { Value: "\u0085apple banana cherr", - ExpectedEOL: eol.NL, + ExpectedEOL: eol.NEL, ExpectedSize: 2, }, {