Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(lint): remove naked return (for sake of clarity) #776

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions key.go
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@
// Read and block.
numBytes, err := input.Read(buf[:])
if err != nil {
return err

Check failure on line 550 in key.go

View workflow job for this annotation

GitHub Actions / lint-soft

error returned from interface method should be wrapped: sig: func (io.Reader).Read(p []byte) (n int, err error) (wrapcheck)
}
b := buf[:numBytes]

Expand All @@ -558,7 +558,7 @@
select {
case msgs <- msg:
case <-ctx.Done():
return ctx.Err()

Check failure on line 561 in key.go

View workflow job for this annotation

GitHub Actions / lint-soft

error returned from interface method should be wrapped: sig: func (context.Context).Err() error (wrapcheck)
}
}
}
Expand All @@ -566,19 +566,18 @@

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)
}

// 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
Loading