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

Fix linter warnings #156

Merged
merged 2 commits into from
Jan 20, 2023
Merged

Fix linter warnings #156

merged 2 commits into from
Jan 20, 2023

Conversation

Zerpet
Copy link
Contributor

@Zerpet Zerpet commented Jan 18, 2023

This PR fixes linter warnings, reported in the Goland IDE. The warnings in
question:

  • Unreachable code
  • Variable names using snake_case instead of CamelCase
  • Unused parameters
  • Redundant parenthesis
  • Shell-bang was not set correctly

Any code after t.Fatalf is not executed, because this function stops
execution.

- Unreachable code
- Variable names using snake_case instead of CamelCase
- Unused parameters
- Redundant parenthesis
- Shell-bang was not set correctly

Any code after `t.Fatalf` is not executed, because this function stops
execution.

Signed-off-by: Aitor Pérez Cedres <[email protected]>
@Zerpet Zerpet added this to the 1.6.0 milestone Jan 18, 2023
@lukebakken
Copy link
Contributor

Don't we have a CI action that should fail because of these issues?

@Zerpet
Copy link
Contributor Author

Zerpet commented Jan 19, 2023

We do have the golangci-lint, but its linter for unused/deadcode doesn't seem to catch this 🤷‍♂️

@Zerpet
Copy link
Contributor Author

Zerpet commented Jan 19, 2023

I've been looking around the linter in golangci-lint, and it doesn't have any linters for unreachable or deadcode. I'm a bit surprised the compiler doesn't warn about this.

I also had a look at staticcheck linter, and it catches a few cosmetic issues (strings should not be capitalized), but it doesn't catch unreachable code.

@lukebakken lukebakken merged commit 32d6f86 into main Jan 20, 2023
@lukebakken lukebakken deleted the linter-warnings branch January 20, 2023 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants