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

[Bug]: make lint complains #404

Closed
3 of 4 tasks
panpan0000 opened this issue May 12, 2023 · 0 comments · Fixed by #405
Closed
3 of 4 tasks

[Bug]: make lint complains #404

panpan0000 opened this issue May 12, 2023 · 0 comments · Fixed by #405

Comments

@panpan0000
Copy link
Contributor

Checklist

  • I've searched for similar issues and couldn't find anything matching
  • I've included steps to reproduce the behavior

Affected Components

  • K8sGPT (CLI)
  • K8sGPT Operator

K8sGPT Version

No response

Kubernetes Version

No response

Host OS and its Version

No response

Steps to reproduce

make lint

Expected behaviour

all pass

Actual behaviour


cmd/generate/generate.go:43:4: ineffectual assignment to backendType (ineffassign)
			backendType = backend
			^
cmd/auth/auth.go:38:12: Error return value of `cmd.Help` is not checked (errcheck)
			cmd.Help()
			        ^
cmd/auth/new.go:36:24: Error return value of `cmd.MarkFlagRequired` is not checked (errcheck)
			cmd.MarkFlagRequired("engine")
			                    ^
cmd/auth/new.go:37:24: Error return value of `cmd.MarkFlagRequired` is not checked (errcheck)
			cmd.MarkFlagRequired("baseurl")
			                    ^
cmd/integration/integration.go:35:11: Error return value of `cmd.Help` is not checked (errcheck)
		cmd.Help()
		        ^
cmd/filters/filters.go:28:12: Error return value of `cmd.Help` is not checked (errcheck)
			cmd.Help()
			        ^
pkg/analysis/analysis.go:237:13: Error return value of `bar.Exit` is not checked (errcheck)
				bar.Exit()
				        ^
pkg/analysis/analysis.go:258:11: Error return value of `bar.Add` is not checked (errcheck)
			bar.Add(1)
			       ^
cmd/serve/serve.go:100:20: Error return value of `logger.Sync` is not checked (errcheck)
		defer logger.Sync()
		                 ^
cmd/root.go:88:24: Error return value of `viper.SafeWriteConfig` is not checked (errcheck)
		viper.SafeWriteConfig()
		                     ^
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 {
     ^
pkg/analyzer/node.go:61:16: S1025: the argument is already a string, there's no need to use fmt.Sprintf (gosimple)
			preAnalysis[fmt.Sprintf("%s", node.Name)] = common.PreAnalysis{
			            ^
pkg/analyzer/pod.go:88:8: S1002: should omit comparison to bool constant, can be simplified to `!containerStatus.Ready` (gosimple)
				if containerStatus.Ready == false && pod.Status.Phase == "Running" {
				   ^
cmd/root.go:98:2: SA9003: empty branch (staticcheck)
	if err := viper.ReadInConfig(); err == nil {
	^

cmd/filters/list.go:40:3: SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck)
		fmt.Printf(color.YellowString("Active: \n"))
		^
cmd/filters/list.go:53:4: SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck)
			fmt.Printf(color.YellowString("Unused: \n"))
			^
pkg/server/server.go:110:2: SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck)
	fmt.Fprintf(w, string(js))
	^
pkg/analysis/analysis.go:170:35: SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck)
						a.Errors = append(a.Errors, fmt.Sprintf(fmt.Sprintf("[%s] %s", filter, err)))
						                            ^
pkg/analysis/analysis.go:179:33: SA1006: printf-style function with dynamic format string and no further arguments should use print-style function instead (staticcheck)
				a.Errors = append(a.Errors, fmt.Sprintf(fmt.Sprintf("\"%s\" filter does not exist. Please run k8sgpt filters list.", filter)))



Additional Information

golangci-lint --version
golangci-lint has version 1.52.2 built with go1.20.2

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 a pull request may close this issue.

1 participant