Merge pull request #5118 from kolyshkin/lint29

ci: bump golangci-lint to v2.10, fix some prealloc linter warnings
This commit is contained in:
lfbzhm
2026-02-27 12:37:12 +08:00
committed by GitHub
3 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -41,7 +41,7 @@ jobs:
sudo apt -qy install libseccomp-dev
- uses: golangci/golangci-lint-action@v9
with:
version: v2.6
version: v2.10
skip-cache: true
# Extra linters, only checking new code from a pull request to main.
- name: lint-extra
+1 -1
View File
@@ -199,7 +199,7 @@ func convertMemoryEntry(c cgroups.MemoryData) types.MemoryEntry {
}
func convertBlkioEntry(c []cgroups.BlkioStatEntry) []types.BlkioEntry {
var out []types.BlkioEntry
out := make([]types.BlkioEntry, 0, len(c))
for _, e := range c {
out = append(out, types.BlkioEntry(e))
}
@@ -41,10 +41,11 @@ func (m Mapping) toSys() (uids, gids []syscall.SysProcIDMap) {
// the uid and gid mappings (because the order doesn't matter to the kernel).
// The set of userns handles is indexed using this ID.
func (m Mapping) id() string {
var uids, gids []string
uids := make([]string, 0, len(m.UIDMappings))
for _, idmap := range m.UIDMappings {
uids = append(uids, fmt.Sprintf("%d:%d:%d", idmap.ContainerID, idmap.HostID, idmap.Size))
}
gids := make([]string, 0, len(m.GIDMappings))
for _, idmap := range m.GIDMappings {
gids = append(gids, fmt.Sprintf("%d:%d:%d", idmap.ContainerID, idmap.HostID, idmap.Size))
}