Skip to content

Commit 2d8bbd9

Browse files
authored
Merge pull request #2211 from coreosbot-releng/repo-templates
Sync repo templates ⚙
2 parents d47fedb + 072be38 commit 2d8bbd9

4 files changed

Lines changed: 16 additions & 5 deletions

File tree

.github/workflows/go.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
name: Test
2121
strategy:
2222
matrix:
23-
go-version: [1.24.x, 1.25.x]
23+
go-version: [1.25.x, 1.26.x]
2424
runs-on: ubuntu-latest
2525
steps:
2626
- name: Set up Go 1.x
@@ -54,7 +54,7 @@ jobs:
5454
- name: Run linter
5555
uses: golangci/golangci-lint-action@v8
5656
with:
57-
version: v2.6.2
57+
version: v2.11.3
5858
regenerate:
5959
name: Regenerate
6060
runs-on: ubuntu-latest
@@ -64,7 +64,7 @@ jobs:
6464
- name: Set up Go 1.x
6565
uses: actions/setup-go@v5
6666
with:
67-
go-version: 1.25.x
67+
go-version: 1.26.x
6868
- name: Install schematyper
6969
run: |
7070
# "go install github.com/idubinskiy/schematyper:latest" fails with

.github/workflows/ignition-validate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
name: Test ignition-validate
2121
strategy:
2222
matrix:
23-
go-version: [1.25.x]
23+
go-version: [1.26.x]
2424
os: [macos-latest, windows-latest]
2525
runs-on: ${{ matrix.os }}
2626
steps:

docs/release-notes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ nav_order: 9
1212

1313
### Changes
1414

15+
- Fix test script compatibility with Go 1.26 which removed the `-go` flag from `go tool fix`
16+
1517
### Bug fixes
1618

1719

test

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,16 @@ PKG_VET=$(go list ./... | \
4545

4646
echo "Checking gofix..."
4747
go_version=$(go version | awk '{print $3}')
48-
go tool fix -go="$go_version" -diff $SRC
48+
# Go 1.26+ removed the -go flag from go tool fix
49+
go_major=$(echo "$go_version" | sed 's/go\([0-9]*\)\.\([0-9]*\).*/\1/')
50+
go_minor=$(echo "$go_version" | sed 's/go\([0-9]*\)\.\([0-9]*\).*/\2/')
51+
if [ "$go_major" -lt 1 ] || { [ "$go_major" -eq 1 ] && [ "$go_minor" -lt 26 ]; }; then
52+
go tool fix -go="$go_version" -diff $SRC
53+
else
54+
# Go 1.26+ uses unitchecker and exits non-zero when it finds fixable issues
55+
# Make this non-fatal since finding fixable code shouldn't fail the build
56+
go tool fix -diff $SRC || true
57+
fi
4958

5059
echo "Checking gofmt..."
5160
res=$(gofmt -d -e -s $SRC)

0 commit comments

Comments
 (0)