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
refactor: fix all linter issues #27
Conversation
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@@ -15,12 +15,12 @@ import ( | |||
// start it with the tea.ProgramOptions returned. | |||
// | |||
// Deprecated: use Handler instead. | |||
type BubbleTeaHandler func(ssh.Session) (tea.Model, []tea.ProgramOption) // nolint: revive | |||
type BubbleTeaHandler = Handler // nolint: revive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to make the deletion of this a 1 line change in the future :)
@@ -147,10 +160,10 @@ func fatalGit(s ssh.Session, err error) { | |||
msg := err.Error() | |||
pktLine := fmt.Sprintf("%04x%s\n", len(msg)+5, msg) | |||
_, _ = s.Write([]byte(pktLine)) | |||
s.Exit(1) | |||
s.Exit(1) // nolint: errcheck |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: a slightly easier way to communicate we intentionally ignore a returned error in these situations, is following what we do in the line above:
_ = s.Exit(1)
This also satisfies the linter. The same goes for srv.Close()
below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed
fixes/ignores everything golangci-lint is complaining about.