diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 36eb47d..da677b8 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,4 +17,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: - version: v1.57 + version: v1.59 diff --git a/Makefile b/Makefile index 5e6a457..6cc22ee 100644 --- a/Makefile +++ b/Makefile @@ -187,10 +187,10 @@ GOIMPORTS ?= $(LOCALBIN)/goimports-$(GOIMPORTS_VERSION) ## Tool Versions KUSTOMIZE_VERSION ?= v5.3.0 -CONTROLLER_TOOLS_VERSION ?= v0.14.0 +CONTROLLER_TOOLS_VERSION ?= v0.15.0 ENVTEST_VERSION ?= latest -GOLANGCI_LINT_VERSION ?= v1.57.2 -GOIMPORTS_VERSION ?= v0.20.0 +GOLANGCI_LINT_VERSION ?= v1.59.1 +GOIMPORTS_VERSION ?= v0.22.0 .PHONY: kustomize kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index 13911fa..73bcaec 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -27,6 +27,6 @@ import ( // Run e2e tests using the Ginkgo runner. func TestE2E(t *testing.T) { RegisterFailHandler(Fail) - fmt.Fprintf(GinkgoWriter, "Starting metal-operator suite\n") + _, _ = fmt.Fprintf(GinkgoWriter, "Starting metal-operator suite\n") RunSpecs(t, "e2e suite") } diff --git a/test/utils/utils.go b/test/utils/utils.go index 7363aa5..72d9b6e 100644 --- a/test/utils/utils.go +++ b/test/utils/utils.go @@ -35,7 +35,7 @@ const ( ) func warnError(err error) { - fmt.Fprintf(GinkgoWriter, "warning: %v\n", err) + _, _ = fmt.Fprintf(GinkgoWriter, "warning: %v\n", err) } // InstallPrometheusOperator installs the prometheus Operator to be used to export the enabled metrics. @@ -52,12 +52,16 @@ func Run(cmd *exec.Cmd) ([]byte, error) { cmd.Dir = dir if err := os.Chdir(cmd.Dir); err != nil { - fmt.Fprintf(GinkgoWriter, "chdir dir: %s\n", err) + if _, err := fmt.Fprintf(GinkgoWriter, "chdir dir: %s\n", err); err != nil { + return nil, fmt.Errorf("%w", err) + } } cmd.Env = append(os.Environ(), "GO111MODULE=on") command := strings.Join(cmd.Args, " ") - fmt.Fprintf(GinkgoWriter, "running: %s\n", command) + if _, err := fmt.Fprintf(GinkgoWriter, "running: %s\n", command); err != nil { + return nil, fmt.Errorf("%w", err) + } output, err := cmd.CombinedOutput() if err != nil { return output, fmt.Errorf("%s failed with error: (%v) %s", command, err, string(output))