From 2f6c0203e9ee0bf87078522c1e4cbae77322de21 Mon Sep 17 00:00:00 2001
From: Pierre Smeyers <pierre.smeyers@gmail.com>
Date: Thu, 27 Mar 2025 10:08:28 +0100
Subject: [PATCH] fix(ci-lint): golangci-lint V2 no longer support 'goimports'
 as a linter, but as formatter

---
 README.md                      | 2 +-
 kicker.json                    | 2 +-
 templates/gitlab-ci-golang.yml | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index fc72898..7a5f323 100644
--- a/README.md
+++ b/README.md
@@ -164,7 +164,7 @@ It is bound to the `build` stage, and uses the following variables:
 | Input / Variable | Description                                                                                              | Default value                          |
 |-----------------------|----------------------------------------------------------------------------------------------------------|----------------------------------------|
 | `ci-lint-image` / `GO_CI_LINT_IMAGE` | The Docker image used to run `golangci-lint`                                                             | `registry.hub.docker.com/golangci/golangci-lint:latest-alpine` <br/>[![Trivy Badge](https://to-be-continuous.gitlab.io/doc/secu/trivy-badge-GO_CI_LINT_IMAGE.svg)](https://to-be-continuous.gitlab.io/doc/secu/trivy-GO_CI_LINT_IMAGE) |
-| `ci-lint-args` / `GO_CI_LINT_ARGS` | `golangci-lint` [command line arguments](https://github.com/golangci/golangci-lint#command-line-options) | `-E gosec,goimports ./...`             |
+| `ci-lint-args` / `GO_CI_LINT_ARGS` | `golangci-lint` [command line arguments](https://github.com/golangci/golangci-lint#command-line-options) | `-E gosec ./...`             |
 | `ci-lint-disabled` / `GO_CI_LINT_DISABLED` | Set to `true` to disable this job                                                                        | _none_ (enabled)                        |
 
 In addition to a textual report in the console, this job produces the following reports, kept for one day:
diff --git a/kicker.json b/kicker.json
index f709fcf..1a592ce 100644
--- a/kicker.json
+++ b/kicker.json
@@ -116,7 +116,7 @@
         {
           "name": "GO_CI_LINT_ARGS",
           "description": "`golangci-lint` [command line arguments](https://github.com/golangci/golangci-lint#command-line-options)",
-          "default": "-E gosec,goimports ./...",
+          "default": "-E gosec ./...",
           "advanced": true
         }
       ]
diff --git a/templates/gitlab-ci-golang.yml b/templates/gitlab-ci-golang.yml
index 4fa21a1..4896e5a 100644
--- a/templates/gitlab-ci-golang.yml
+++ b/templates/gitlab-ci-golang.yml
@@ -80,7 +80,7 @@ spec:
       default: registry.hub.docker.com/golangci/golangci-lint:latest-alpine
     ci-lint-args:
       description: '`golangci-lint` [command line arguments](https://github.com/golangci/golangci-lint#command-line-options)'
-      default: -E gosec,goimports ./...
+      default: -E gosec ./...
     semgrep-image:
       description: The Docker image used to run [Semgrep](https://semgrep.dev/docs/)
       default: registry.hub.docker.com/semgrep/semgrep:latest
-- 
GitLab