initial commits
parent
e2bed68430
commit
97238f4932
|
@ -6,7 +6,7 @@ import (
|
||||||
"sourcecode.social/reiver/go-opt"
|
"sourcecode.social/reiver/go-opt"
|
||||||
)
|
)
|
||||||
|
|
||||||
// ReadEOL tries to read and end-of-line character.
|
// ReadEOL tries to read an end-of-line sequence.
|
||||||
//
|
//
|
||||||
// The end-of-line sequences it supports are:
|
// The end-of-line sequences it supports are:
|
||||||
//
|
//
|
||||||
|
@ -17,6 +17,10 @@ import (
|
||||||
// line-separator (LS) (U+2028)
|
// line-separator (LS) (U+2028)
|
||||||
//
|
//
|
||||||
// If successful, ReadEOL return the end-of-line sequence it found and the number-of-bytes read (to read in end-of-line sequence it found).
|
// If successful, ReadEOL return the end-of-line sequence it found and the number-of-bytes read (to read in end-of-line sequence it found).
|
||||||
|
//
|
||||||
|
// Example usage:
|
||||||
|
///
|
||||||
|
// eolSequence, size: err := eol.ReadEOL(runescanner)
|
||||||
func ReadEOL(runescanner io.RuneScanner) (endofline string, size int, err error) {
|
func ReadEOL(runescanner io.RuneScanner) (endofline string, size int, err error) {
|
||||||
if nil == runescanner {
|
if nil == runescanner {
|
||||||
return "", 0, errNilRuneScanner
|
return "", 0, errNilRuneScanner
|
||||||
|
|
Loading…
Reference in New Issue