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: gocritic linter issues #60

Open
wants to merge 1 commit into
base: beta
Choose a base branch
from

Conversation

alexandear
Copy link

@alexandear alexandear commented Oct 26, 2023

Description

This PR enables gocritic linter and fixes the following linter issues:

❯ ./bin/golangci-lint run
pkg/database/handler.go:81:4: exitAfterDefer: log.Fatal will exit, and `defer rows.Close()` will not run (gocritic)
                        log.Fatal(err)
                        ^
pkg/cache/lrucache_test.go:41:3: assignOp: replace `i = i + 1` with `i++` (gocritic)
                i = i + 1
                ^
pkg/providers/cache.go:44:46: captLocal: `URL' should not be capitalized (gocritic)
func (lc *LRUCacheGitRepoProvider) FetchRepo(URL string) (GitRepo, error) {
                                             ^
pkg/providers/memory.go:26:46: captLocal: `URL' should not be capitalized (gocritic)
func (im *InMemoryGitRepoProvider) FetchRepo(URL string) (GitRepo, error) {
                                             ^
pkg/server/server.go:62:2: exitAfterDefer: log.Fatal will exit, and `defer p.Logger.Sync()` will not run (gocritic)
        log.Fatal(http.ListenAndServe(fmt.Sprintf(":%s", serverPort), nil))
        ^

What type of PR is this? (check all applicable)

  • 🍕 Feature
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements
  • ✅ Test
  • 🤖 Build
  • 🔁 CI
  • 📦 Chore (Release)
  • ⏩ Revert

Related Tickets & Documents

Updates #49

log.Fatal mistake was found by reading the article https://dev.to/opensauced/how-we-made-our-go-microservice-24x-faster-5h3l

Mobile & Desktop Screenshots/Recordings

Added tests?

  • 👍 yes
  • 🙅 no, because they aren't needed
  • 🙋 no, because I need help

Added to documentation?

  • 📜 README.md
  • 📓 docs.opensauced.pizza
  • 🍕 dev.to/opensauced
  • 📕 storybook
  • 🙅 no documentation needed

[optional] Are there any post-deployment tasks we need to perform?

[optional] What gif best describes this PR or how it makes you feel?

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

PR Compliance Checks

Thank you for your Pull Request! We have run several checks on this pull request in order to make sure it's suitable for merging into this project. The results are listed in the following section.

Issue Reference

In order to be considered for merging, the pull request description must refer to a specific issue number. This is described in our Contributing Guide.
This check is looking for a phrase similar to: "Fixes #XYZ" or "Resolves #XYZ" where XYZ is the issue number that this PR is meant to address.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Congrats on making your first Pull Request and thanks for taking the time to improve Open Sauced! ❤️! 🎉🍕
Say hello by joining the conversation in our Discord

Copy link
Member

@jpmcb jpmcb left a comment

Choose a reason for hiding this comment

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

Hi @alexandear - very solid!! 👏🏼 Thanks so much for the contribution!!

@jpmcb jpmcb requested a review from a team November 21, 2023 22:32
Copy link

@OgDev-01 OgDev-01 left a comment

Choose a reason for hiding this comment

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

🍕

Copy link
Member

@nickytonline nickytonline left a comment

Choose a reason for hiding this comment

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

🚀

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.

4 participants