From cbbbbadc8998ace6b09fb47c9f0dac9dd8fd3e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Cuadrado=20Juan?= Date: Wed, 28 Aug 2024 16:10:39 +0200 Subject: [PATCH] chore: Add //nolint:gosec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ParseInt(x,x,32) makes sure it will fit into int32. See also https://github.com/securego/gosec/issues/1185 Signed-off-by: VĂ­ctor Cuadrado Juan --- internal/controller/policyserver_controller_service.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/controller/policyserver_controller_service.go b/internal/controller/policyserver_controller_service.go index c7891be6..bfb48009 100644 --- a/internal/controller/policyserver_controller_service.go +++ b/internal/controller/policyserver_controller_service.go @@ -28,6 +28,7 @@ func getMetricsPort() int32 { fmt.Fprintf(os.Stderr, "port %s provided in %s envvar cannot be parsed as integer: %v. Aborting.\n", envMetricsPort, constants.PolicyServerMetricsPortEnvVar, err) os.Exit(1) } + //nolint:gosec // ParseInt(x,x,32) makes sure it will fit into int32 metricsPort = int32(metricsPortInt32) } return metricsPort