From efcad45cd116fba4e0de081881f8d2acd88891ac Mon Sep 17 00:00:00 2001 From: Charles Iliya Krempeaux Date: Mon, 27 Nov 2023 06:47:38 -0800 Subject: [PATCH] initial commits --- errors.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 errors.go diff --git a/errors.go b/errors.go new file mode 100644 index 0000000..e6741c7 --- /dev/null +++ b/errors.go @@ -0,0 +1,21 @@ +package eol + +import ( + "sourcecode.social/reiver/go-erorr" +) + +const ( + errNilRuneScanner = erorr.Error("eol: nil rune-scanner") +) + +func errNotEOL(r rune) error { + return erorr.Errorf("eol: %q (%U) is not an end-of-line character", r, r) +} + +func errProblemReadingRune(err error, runeNumber uint64) error { + return erorr.Errorf("eol: problem reading rune №%d of end-of-line sequence: %w", runeNumber, err) +} + +func errProblemUnreadingRune(err error, runeNumber uint64, r rune) error { + return erorr.Errorf("eol: problem unreading rune №%d (%q (%U)) of end-of-line sequence: %w", runeNumber, r, r, err) +}