From 10076d69ea39fe5ff37454b8bc07b160b8013187 Mon Sep 17 00:00:00 2001 From: Nick Dumas Date: Sun, 25 Jun 2023 10:44:58 -0400 Subject: [PATCH] Fixing concurrency problems --- states.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/states.go b/states.go index dec93ce..4ed8c98 100644 --- a/states.go +++ b/states.go @@ -44,9 +44,11 @@ func lexIdent(l *Lexer) stateFn { case isHeading(s): l.emit(ItemIdent) return lexHeading + } } - return nil + panic("we shouldn't be here") + return nil // this shouldn't ever be reached } func lexHeading(l *Lexer) stateFn { @@ -78,7 +80,8 @@ func lexText(l *Lexer) stateFn { r := l.next() switch { case r == EOF || r == '\n': - return l.errorf("wikilink terminated incorrectly") + l.emit(ItemText) + return nil } } }