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

chore: make go-lint happy #405

Merged
merged 1 commit into from
May 12, 2023
Merged

chore: make go-lint happy #405

merged 1 commit into from
May 12, 2023

Conversation

panpan0000
Copy link
Contributor

@panpan0000 panpan0000 commented May 12, 2023

Closes #404

📑 Description

Fix part of the lint errors.
But I didn't fix them all

(1)Some health relevant code and unused functions I believe will be refine later by their authors?
(2) For code cmd/generate/generate.go:43, I don't understand what it means by override the default backend if a flag is provided.

So there are some issues left as below, later when they are all fixed, we can enable lint test in CI as PR Gate:

 make lint
INFO [lintersdb] Active 7 linters: [errcheck gosimple govet ineffassign staticcheck typecheck unused]

cmd/generate/generate.go:43:4: ineffectual assignment to backendType (ineffassign)
			backendType = backend
			^
pkg/server/server.go:41:2: field `maxConcurrency` is unused (unused)
	maxConcurrency int
	^
pkg/server/server.go:53:5: var `health` is unused (unused)
var health = Health{
    ^
pkg/server/server.go:104:18: func `(*Config).healthzHandler` is unused (unused)
func (s *Config) healthzHandler(w http.ResponseWriter, r *http.Request) {
                 ^
pkg/server/server.go:113:6: func `getBoolParam` is unused (unused)
func getBoolParam(param string) bool {
     ^
cmd/serve/serve.go:100:20: Error return value of `logger.Sync` is not checked (errcheck)
		defer logger.Sync()
		                 ^
INFO File cache stats: 3 entries of total size 8.9KiB

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

ℹ Additional Information

@panpan0000 panpan0000 requested review from a team as code owners May 12, 2023 11:14
Signed-off-by: Peter Pan <Peter.Pan@daocloud.io>
Copy link
Member

@AlexsJones AlexsJones left a comment

Choose a reason for hiding this comment

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

Great contribution thank you

@AlexsJones AlexsJones merged commit ed73485 into k8sgpt-ai:main May 12, 2023
@panpan0000 panpan0000 mentioned this pull request May 15, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug]: make lint complains
2 participants