Skip to content

Commit

Permalink
Fixed linter
Browse files Browse the repository at this point in the history
* use the latest version of golangci-lint in github actions
* add the target of lint in Makefile
* fix nolint errcheck
  • Loading branch information
u5surf committed Oct 25, 2023
1 parent cd1e922 commit 41d6967
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/golangci-lint.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "golangci-lint"
name: "Golang Lint"
on:
- push
- pull_request
Expand All @@ -16,5 +16,5 @@ jobs:
- name: lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
args: --timeout=30m
version: v1.55
args: --timeout=5m
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ fmt:
vet:
go vet ./...

# Run golangci-lint
lint:
go install github.com/golangci/golangci-lint/cmd/[email protected]
golangci-lint --timeout 5m run ./...
# Generate code
generate: controller-gen
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
Expand Down
2 changes: 1 addition & 1 deletion controllers/testrun_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (r *TestRunReconciler) reconcile(ctx context.Context, req ctrl.Request, log
// delete if configured
if k6.GetSpec().Cleanup == "post" {
log.Info("Cleaning up all resources")
r.Delete(ctx, k6) //nolint:errcheck
_ = r.Delete(ctx, k6)
}
// notify if configured
return ctrl.Result{}, nil
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ func main() {
os.Exit(1)
}

mgr.AddHealthzCheck("health", healthz.Ping) //nolint:errcheck
mgr.AddReadyzCheck("ready", healthz.Ping) //nolint:errcheck
_ = mgr.AddHealthzCheck("health", healthz.Ping)
_ = mgr.AddReadyzCheck("ready", healthz.Ping)

if err = (controllers.NewK6Reconciler(&controllers.TestRunReconciler{
Client: mgr.GetClient(),
Expand Down

0 comments on commit 41d6967

Please sign in to comment.