Skip to content

Commit

Permalink
libct/cg: use clear built-in
Browse files Browse the repository at this point in the history
As we no longer support Go < 1.21.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed May 30, 2024
1 parent fc21668 commit c20f7e5
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions libcontainer/cgroups/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c20f7e5

Please sign in to comment.