Upgrade GolangCI-Lint to latest version in Analyzers CI templates

The following discussion from gitlab-org/security-products/ci-templates!373 (merged) should be addressed:

Problem

The current version of GolangCI-Lint in our CI Templates is v1.50.1, which is outdated. Upgrading to the latest version is necessary for leveraging new linting features and improvements. However, this upgrade introduces breaking changes that affect the Gemnasium build, requiring lint error resolutions prior to the upgrade.

Solution

Update the GolangCI-Lint version in the CI Templates to v1.60.3 and address the linting issues that cause the Gemnasium build to fail. This will ensure our codebase aligns with the latest linting standards and practices.

Suggested Changes in CI File:

To upgrade the GolangCI-Lint version in your CI file, modify the GOLANGCI_LINT_VERSION variable as shown below:

variables:
  GO_VERSION: "1.19"
  GOLANGCI_LINT_VERSION: "v1.60.3" 

Ensure to review and fix any new linting issues that arise due to this version upgrade, particularly those affecting the Gemnasium build.

Implementation Plan

  1. Fix lint violations with golangci-lint v1.52.2 in the following projects:

  2. Upgrade the ci-templates project:

  3. Rerun pipelines for all of the above analyzers, to ensure that the go lint job succeeds.

Edited by Adam Cohen