Skip to content

Commit 73599a1

Browse files
committed
Remove redundant function
1 parent 346b818 commit 73599a1

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/opencontainers/runc
22

3-
go 1.22
3+
go 1.23
44

55
require (
66
github.com/checkpoint-restore/go-criu/v6 v6.3.0

libcontainer/capabilities/capabilities.go

+3-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
package capabilities
44

55
import (
6-
"sort"
6+
"maps"
7+
"slices"
78
"strings"
89

910
"github.com/opencontainers/runc/libcontainer/configs"
@@ -69,7 +70,7 @@ func New(capConfig *configs.Capabilities) (*Caps, error) {
6970
return nil, err
7071
}
7172
if len(unknownCaps) > 0 {
72-
logrus.Warn("ignoring unknown or unavailable capabilities: ", mapKeys(unknownCaps))
73+
logrus.Warn("ignoring unknown or unavailable capabilities: ", slices.Sorted(maps.Keys(unknownCaps)))
7374
}
7475
return &c, nil
7576
}
@@ -89,16 +90,6 @@ func capSlice(caps []string, unknownCaps map[string]struct{}) []capability.Cap {
8990
return out
9091
}
9192

92-
// mapKeys returns the keys of input in sorted order
93-
func mapKeys(input map[string]struct{}) []string {
94-
var keys []string
95-
for c := range input {
96-
keys = append(keys, c)
97-
}
98-
sort.Strings(keys)
99-
return keys
100-
}
101-
10293
// Caps holds the capabilities for a container.
10394
type Caps struct {
10495
pid capability.Capabilities

0 commit comments

Comments
 (0)