From edeb6ba9fbeab2675cd7086ef3b77ae8a43ac585 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 21 Aug 2024 15:58:33 +0200 Subject: [PATCH] golangci-lint: temporarily disable G115: integer overflow conversion it produces many hits, some of which may be false positives, but we need to look into these, e.g.; container/container.go:517:72: G115: integer overflow conversion int -> uint32 (gosec) shouldRestart, _, _ := container.RestartManager().ShouldRestart(uint32(container.ExitCode()), container.HasBeenManuallyStopped, container.FinishedAt.Sub(container.StartedAt)) ^ container/view.go:401:25: G115: integer overflow conversion int -> uint16 (gosec) PrivatePort: uint16(p), ^ container/view.go:413:25: G115: integer overflow conversion int -> uint16 (gosec) PrivatePort: uint16(p), ^ container/view.go:414:25: G115: integer overflow conversion int -> uint16 (gosec) PublicPort: uint16(h), ^ Signed-off-by: Sebastiaan van Stijn (cherry picked from commit f5108e9c6bfde83b7774dafaa355b6a413201131) Signed-off-by: Sebastiaan van Stijn --- .golangci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 42dd1c69d2..51fc021f62 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -45,6 +45,11 @@ linters-settings: govet: check-shadowing: false + + gosec: + excludes: + - G115 # FIXME temporarily suppress 'G115: integer overflow conversion': it produces many hits, some of which may be false positives, and need to be looked at; see https://github.com/moby/moby/issues/48358 + depguard: rules: main: