From 851bffc0f1b2fe99c099190450cb1c20d98cd254 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Thu, 23 Dec 2021 00:31:04 +0100 Subject: [PATCH] enable gosec linter --- .golangci.yml | 4 ++++ internal/common/common_unix.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index a7f8c36..3dc09df 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,6 +2,9 @@ issues: max-same-issues: 0 exclude-rules: - linters: + - gosec + text: "G204" + - linters: - revive text: "var-naming" - linters: @@ -15,6 +18,7 @@ linters: - gci - gofmt - gofumpt + - gosec - gosimple - misspell - nolintlint diff --git a/internal/common/common_unix.go b/internal/common/common_unix.go index a4a953a..e0170f9 100644 --- a/internal/common/common_unix.go +++ b/internal/common/common_unix.go @@ -57,7 +57,7 @@ func CallPgrepWithContext(ctx context.Context, invoke Invoker, pid int32) ([]int if len(l) == 0 { continue } - i, err := strconv.Atoi(l) + i, err := strconv.ParseInt(l, 10, 32) if err != nil { continue }