Skip to content

Commit

Permalink
chore(lint): remove naked return (for sake of clarity)
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm committed Jul 6, 2023
1 parent ea7ceb7 commit 6f5d441
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions key.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Check failure on line 572 in key.go

View workflow job for this annotation

GitHub Actions / lint-soft

mnd: Magic number: 6, in <return> detected (gomnd)
Expand All @@ -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.
Expand Down

0 comments on commit 6f5d441

Please sign in to comment.