Skip to content

Commit

Permalink
chore: Add //nolint:gosec
Browse files Browse the repository at this point in the history
ParseInt(x,x,32) makes sure it will fit into int32.

See also securego/gosec#1185

Signed-off-by: Víctor Cuadrado Juan <vcuadradojuan@suse.de>
  • Loading branch information
viccuad committed Aug 28, 2024
1 parent c76a223 commit cbbbbad
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions internal/controller/policyserver_controller_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cbbbbad

Please sign in to comment.