From 28a51a754f2578935a9feffb47af96cfa2eae8f3 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 13 Aug 2026 00:16:20 +0200 Subject: [PATCH 1/4] go.mod: raise minimum go version to go1.21 commit 07c1312594618861173ae97bbd494622e02cd2b2 added use of log/slog, which requires go1.21. Signed-off-by: Sebastiaan van Stijn --- go.mod | 2 +- go.sum | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 9915b29..5d33950 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/containerd/log -go 1.20 +go 1.21 require github.com/sirupsen/logrus v1.9.4 diff --git a/go.sum b/go.sum index adcf7b5..9e91db8 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,12 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sirupsen/logrus v1.9.4 h1:TsZE7l11zFCLZnZ+teH4Umoq5BhEIfIzfRDZ1Uzql2w= github.com/sirupsen/logrus v1.9.4/go.mod h1:ftWc9WdOfJ0a92nsE2jF5u5ZwH8Bv2zdeOC42RjbV2g= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From 72e7beb9af2e42861bd65059b28a352a1aae835f Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 13 Aug 2026 00:05:24 +0200 Subject: [PATCH 2/4] ci: test against module, oldstable, and stable Go versions Signed-off-by: Sebastiaan van Stijn --- .github/workflows/ci.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6f3e87d..966266e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,9 +7,7 @@ on: branches: [ main ] env: - # Go version we currently use to build containerd across all CI. - # Note: don't forget to update `Binaries` step, as it contains the matrix of all supported Go versions. - GO_VERSION: "1.22.8" + GOTOOLCHAIN: local permissions: # added using https://github.com/step-security/secure-workflows contents: read @@ -29,12 +27,12 @@ jobs: strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/setup-go@v7 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false # see actions/setup-go#368 - uses: actions/checkout@v6 @@ -56,7 +54,7 @@ jobs: steps: - uses: actions/setup-go@v7 with: - go-version: ${{ env.GO_VERSION }} + go-version: stable cache: false # see actions/setup-go#368 - uses: actions/checkout@v6 @@ -70,10 +68,17 @@ jobs: repo-access-token: ${{ secrets.GITHUB_TOKEN }} tests: - name: Tests + name: Tests / ${{ matrix.go-version || 'go.mod' }} runs-on: ubuntu-latest timeout-minutes: 5 + strategy: + matrix: + go-version: + - "" # leave empty to use go-version-file (go.mod) + - oldstable + - stable + steps: - uses: actions/checkout@v6 with: @@ -81,7 +86,8 @@ jobs: - uses: actions/setup-go@v7 with: - go-version: ${{ env.GO_VERSION }} + go-version: ${{ matrix.go-version }} + go-version-file: src/github.com/containerd/log/go.mod # used when go-version is empty - name: Set env shell: bash From caec15cd5e6cb41d47f07dc9e6f0d058ff728ff2 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 13 Aug 2026 00:07:20 +0200 Subject: [PATCH 3/4] ci: update golangci-lint to v2.12 Signed-off-by: Sebastiaan van Stijn --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 966266e..51eeea1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: - uses: actions/checkout@v6 - uses: golangci/golangci-lint-action@v9 with: - version: v2.1.6 + version: v2.12 skip-cache: true args: --timeout=5m From b05875deb7f43eaf7b0bf096132d28c5552330e0 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Thu, 13 Aug 2026 00:21:15 +0200 Subject: [PATCH 4/4] ci: enforce LF line endings for text files Avoid Windows checkouts converting files to CRLF, which causes gofmt cheks to fail. Signed-off-by: Sebastiaan van Stijn --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..6313b56 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto eol=lf