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 lint error #238

Merged
merged 1 commit into from
Jan 30, 2025
Merged

Fix lint error #238

merged 1 commit into from
Jan 30, 2025

Conversation

ymktmk
Copy link
Contributor

@ymktmk ymktmk commented Jan 15, 2025

Fixed multiple lint errors like the one below .

pkg/job/watcher.go:51:17: Error return value of `w.WatchPods` is not checked (errcheck)
  		go w.WatchPods(ctx, incrementalPodList)
  		              ^
  cmd/root.go:21:17: Error return value of `viper.BindPFlag` is not checked (errcheck)
  	viper.BindPFlag("config", RootCmd.PersistentFlags().Lookup("config"))
  	               ^
  pkg/job/watcher.go:[88](https://github.com/h3poteto/kube-job/actions/runs/12780562073/job/35627023901#step:3:93):2: S1000: should use a simple channel send/receive instead of `select` with a single case (gosimple)
  	select {
  	^
  pkg/job/watcher.go:133:2: S1008: should use 'return pod.Status.Phase == corev1.PodPending' instead of 'if pod.Status.Phase == corev1.PodPending { return true }; return false' (gosimple)
  	if pod.Status.Phase == corev1.PodPending {
  	^
  e2e/e2e_test.go:170:9: SA1019: wait.Poll is deprecated: This method does not return errors from context, use PollUntilContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
  	err := wait.Poll(10*time.Second, 10*time.Minute, func() (bool, error) {
  	       ^
  e2e/e2e_test.go:211:9: SA1019: wait.PollImmediate is deprecated: This method does not return errors from context, use PollUntilContextTimeout. Note that the new method will no longer return ErrWaitTimeout and instead return errors defined by the context package. Will be removed in a future release. (staticcheck)
  	return wait.PollImmediate(3*time.Second, 1*time.Minute, func() (bool, error) {
  	       ^
  pkg/job/job.go:11:2: SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details. (staticcheck)
  	"io/ioutil"
  	^

@ymktmk ymktmk requested a review from h3poteto as a code owner January 15, 2025 03:31
@ymktmk ymktmk changed the title fix: lint error Fix lint error Jan 15, 2025
Comment on lines +13 to +14
with:
golangci_lint_flags: --timeout=10m
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added because the following error occurred

level=error msg="Timeout exceeded: try increasing it by passing --timeout option"

Copy link
Owner

@h3poteto h3poteto left a comment

Choose a reason for hiding this comment

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

Thanks

@h3poteto h3poteto merged commit bc21080 into h3poteto:master Jan 30, 2025
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