Skip to content

Commit aee2bd6

Browse files
committed
ci: drop Go 1.18 from CI matrix, bump user to go 1.24
The user module now requires Go 1.24 for os.Root support. Remove Go 1.18 from the CI test matrix. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
1 parent ae0a5c0 commit aee2bd6

File tree

4 files changed

+6
-29
lines changed

4 files changed

+6
-29
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
test:
2020
strategy:
2121
matrix:
22-
go-version: [1.18.x, oldstable, stable]
22+
go-version: [oldstable, stable]
2323
platform: [ubuntu-22.04, ubuntu-24.04, windows-2022, windows-2025, macos-15, macos-26]
2424
runs-on: ${{ matrix.platform }}
2525
timeout-minutes: 10 # guardrails timeout for the whole job
@@ -44,24 +44,6 @@ jobs:
4444
# We don't need to run golangci-lint here yet, but
4545
# there's no way to avoid it, so run it on one module.
4646
working-directory: ./mountinfo
47-
- name: Set PACKAGES env
48-
if: ${{ matrix.go-version == '1.18.x' }}
49-
run: |
50-
# Check if the module supports this version of Go.
51-
go_version="$(go env GOVERSION)"
52-
go_version="${go_version#go}"
53-
54-
packages=""
55-
for p in */; do
56-
[ -f "$p/go.mod" ] || continue
57-
if ! (cd "$p" && go list -m -f "{{if gt .GoVersion \"$go_version\"}}ko{{end}}" | grep -q ko); then
58-
packages+="${p%/} "
59-
else
60-
echo "::notice::SKIP: github.com/moby/sys/${p%/} requires a more recent version of Go"
61-
fi
62-
done
63-
64-
echo "PACKAGES=${packages}" >> "$GITHUB_ENV"
6547
- name: go mod tidy
6648
run: |
6749
make foreach CMD="go mod tidy"

user/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/moby/sys/user
22

3-
go 1.18
3+
go 1.24
44

55
require golang.org/x/sys v0.1.0
66

user/idtools_unix_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ package user
55
import (
66
"errors"
77
"fmt"
8+
"maps"
89
"os"
910
"path/filepath"
1011
"testing"
@@ -292,9 +293,7 @@ func readTree(base, root string) (map[string]node, error) {
292293
if err != nil {
293294
return nil, err
294295
}
295-
for path, nodeinfo := range subtree {
296-
tree[path] = nodeinfo
297-
}
296+
maps.Copy(tree, subtree)
298297
}
299298
}
300299
return tree, nil

user/user.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88
"io"
99
"os"
10+
"slices"
1011
"strconv"
1112
"strings"
1213
)
@@ -373,12 +374,7 @@ func GetExecUser(userSpec string, defaults *ExecUser, passwd, group io.Reader) (
373374
// If the group argument isn't explicit, we'll just search for it.
374375
if groupArg == "" {
375376
// Check if user is a member of this group.
376-
for _, u := range g.List {
377-
if u == matchedUserName {
378-
return true
379-
}
380-
}
381-
return false
377+
return slices.Contains(g.List, matchedUserName)
382378
}
383379

384380
if gidErr == nil {

0 commit comments

Comments
 (0)