From b72e13a9a04b525c9fa83231d8e4e2d0d7b41221 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Fri, 24 May 2024 17:02:39 -0700 Subject: [PATCH] libct/cg: use clear built-in As we no longer support Go < 1.21. Signed-off-by: Kir Kolyshkin --- libcontainer/cgroups/utils.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libcontainer/cgroups/utils.go b/libcontainer/cgroups/utils.go index 186cbc6413f..8bec8c36f16 100644 --- a/libcontainer/cgroups/utils.go +++ b/libcontainer/cgroups/utils.go @@ -275,9 +275,7 @@ func RemovePaths(paths map[string]string) (err error) { } } if len(paths) == 0 { - //nolint:ineffassign,staticcheck // done to help garbage collecting: opencontainers/runc#2506 - // TODO: switch to clear once Go < 1.21 is not supported. - paths = make(map[string]string) + clear(paths) return nil } return fmt.Errorf("Failed to remove paths: %v", paths)