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

refactor: fix all linter issues #27

Merged
merged 2 commits into from Jan 17, 2022
Merged

refactor: fix all linter issues #27

merged 2 commits into from Jan 17, 2022

Conversation

caarlos0
Copy link
Member

fixes/ignores everything golangci-lint is complaining about.

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@caarlos0 caarlos0 added the enhancement New feature or request label Jan 17, 2022
@caarlos0 caarlos0 requested a review from toby January 17, 2022 19:25
@caarlos0 caarlos0 self-assigned this Jan 17, 2022
@@ -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
Copy link
Member Author

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

Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
@caarlos0 caarlos0 merged commit eda4534 into main Jan 17, 2022
@caarlos0 caarlos0 deleted the lint branch January 17, 2022 19:34
@@ -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
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants