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

Implement golang static analyzer findings #601

Merged
merged 17 commits into from
Oct 7, 2024
Merged

Conversation

mfielding
Copy link
Contributor

Running a few golang static analyzers on the code under /v2, they have a few recommendations:

  1. Unnecessary nil checks that are always true (https://staticcheck.io/docs/checks#SA4031, https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/nilness)
  2. Unkeyed composite literals in database/sql.Null types (https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/composite)
  3. Using strings.EqualFold to compare string equality, which is much faster (https://staticcheck.dev/docs/checks#SA6005)
  4. Two cases in custom_types.go where we don't check for errors (https://staticcheck.io/docs/checks#SA4006)
  5. Adding spaces after // comments for readability

@sijms sijms merged commit 40067b5 into sijms:master Oct 7, 2024
0 of 3 checks passed
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