From ff4ff9d45f12894c2740f085869eac091bada011 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 2 Oct 2020 10:18:42 +0200 Subject: [PATCH] fix some linting issues Signed-off-by: Sebastiaan van Stijn --- libcontainer/cgroups/utils.go | 1 + libcontainer/init_linux.go | 1 + libcontainer/intelrdt/intelrdt.go | 6 +----- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libcontainer/cgroups/utils.go b/libcontainer/cgroups/utils.go index 58cc4e19cb3..c100e3e75f2 100644 --- a/libcontainer/cgroups/utils.go +++ b/libcontainer/cgroups/utils.go @@ -277,6 +277,7 @@ func RemovePaths(paths map[string]string) (err error) { } } if len(paths) == 0 { + //nolint:ineffasign // done to help garbage collecting: opencontainers/runc#2506 paths = make(map[string]string) return nil } diff --git a/libcontainer/init_linux.go b/libcontainer/init_linux.go index 11dfe17e1d1..575dd461200 100644 --- a/libcontainer/init_linux.go +++ b/libcontainer/init_linux.go @@ -432,6 +432,7 @@ func setupRlimits(limits []configs.Rlimit, pid int) error { const _P_PID = 1 +//nolint:structcheck,unused type siginfo struct { si_signo int32 si_errno int32 diff --git a/libcontainer/intelrdt/intelrdt.go b/libcontainer/intelrdt/intelrdt.go index d72aaf1257b..7c043136c11 100644 --- a/libcontainer/intelrdt/intelrdt.go +++ b/libcontainer/intelrdt/intelrdt.go @@ -295,11 +295,7 @@ func getIntelRdtRoot() (string, error) { func isIntelRdtMounted() bool { _, err := getIntelRdtRoot() - if err != nil { - return false - } - - return true + return err == nil } type cpuInfoFlags struct {