From 6f5d441cdd96c7232589ce68404a0525e3283620 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Thu, 6 Jul 2023 15:01:43 -0400 Subject: [PATCH] chore(lint): remove naked return (for sake of clarity) --- key.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/key.go b/key.go index 74f85ec405..86b69a83e1 100644 --- a/key.go +++ b/key.go @@ -566,7 +566,7 @@ func readInputs(ctx context.Context, msgs chan<- Msg, input io.Reader) error { var unknownCSIRe = regexp.MustCompile(`^\x1b\[[\x30-\x3f]*[\x20-\x2f]*[\x40-\x7e]`) -func detectOneMsg(b []byte) (w int, msg Msg) { +func detectOneMsg(b []byte) (int, Msg) { // Detect mouse events. if len(b) >= 6 && b[0] == '\x1b' && b[1] == '[' && b[2] == 'M' { return 6, MouseMsg(parseX10MouseEvent(b)) @@ -575,10 +575,9 @@ func detectOneMsg(b []byte) (w int, msg Msg) { // Detect escape sequence and control characters other than NUL, // possibly with an escape character in front to mark the Alt // modifier. - var foundSeq bool - foundSeq, w, msg = detectSequence(b) + foundSeq, w, msg := detectSequence(b) if foundSeq { - return + return w, msg } // No non-NUL control character or escape sequence.