Skip to content

Commit bff11e9

Browse files
authored
Go 1.23 support, go-algorand-sdk dependency on develop commit (#1636)
* Go 1.23 support, go-algorand-sdk dependency on develop commit. * Adjust to loop variable changes Go 1.22
1 parent e0fc340 commit bff11e9

File tree

18 files changed

+178
-334
lines changed

18 files changed

+178
-334
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: 2.1
22

33
orbs:
4-
go: circleci/go@1.7.3
4+
go: circleci/go@1.12.0
55
slack: circleci/slack@4.7.1
66
codecov: codecov/codecov@3.2.4
77

@@ -18,7 +18,7 @@ workflows:
1818
name: test_with_go_<< matrix.go_version >>
1919
matrix: &go-version-matrix
2020
parameters:
21-
go_version: ["1.21.10"]
21+
go_version: ["1.23.3"]
2222

2323
circleci_build_and_test_nightly:
2424
triggers:
@@ -33,7 +33,7 @@ workflows:
3333
context: lamprey-secrets
3434
matrix: &go-version-matrix
3535
parameters:
36-
go_version: ["1.21.10"]
36+
go_version: ["1.23.3"]
3737
- indexer_vs_algod_nightly:
3838
name: nightly_test_indexer_vs_algod
3939
context: lamprey-secrets
@@ -135,7 +135,7 @@ commands:
135135
steps:
136136
- run:
137137
name: Install golangci-lint
138-
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.53.2
138+
command: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62.0
139139

140140
run_e2e_tests:
141141
steps:

.github/workflows/goreleaser.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ jobs:
1212
goreleaser:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v3.5.3
15+
- uses: actions/checkout@v4
1616
with:
1717
fetch-depth: 0
1818
- run: git fetch --force --tags
1919

2020
- name: go dependency
21-
uses: actions/setup-go@v4.0.1
21+
uses: actions/setup-go@v5
2222
with:
2323
go-version-file: 'go.mod'
2424

.github/workflows/pr-type-category.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
name: Check PR Category and Type
1111
steps:
1212
- name: Checking for correct number of required github pr labels
13-
uses: mheap/github-action-required-labels@v2
13+
uses: mheap/github-action-required-labels@v5
1414
with:
1515
mode: exactly
1616
count: 1

.github/workflows/reviewdog.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Check out code into the Go module directory
10-
uses: actions/checkout@v3.5.3
10+
uses: actions/checkout@v4
1111
with:
1212
fetch-depth: 0 # required for new-from-rev option in .golangci.yml
1313
- name: Install specific golang
14-
uses: actions/setup-go@v4.0.1
14+
uses: actions/setup-go@v5
1515
with:
16-
go-version: '1.21.10'
16+
go-version: '1.23.3'
1717
- name: reviewdog-golangci-lint
18-
uses: reviewdog/action-golangci-lint@v2.6.1
18+
uses: reviewdog/action-golangci-lint@v2.6.2
1919
with:
2020
go_version_file: go.mod
21-
golangci_lint_version: "v1.58.0"
21+
golangci_lint_version: "v1.62.0"
2222
golangci_lint_flags: "-c .golangci.yml --allow-parallel-runners"
2323
reporter: "github-pr-check"
2424
tool_name: "Lint Errors"
@@ -30,18 +30,18 @@ jobs:
3030
runs-on: ubuntu-latest
3131
steps:
3232
- name: Check out code into the Go module directory
33-
uses: actions/checkout@v3.5.3
33+
uses: actions/checkout@v4
3434
with:
3535
fetch-depth: 0 # required for new-from-rev option in .golangci.yml
3636
- name: Install specific golang
37-
uses: actions/setup-go@v4.0.1
37+
uses: actions/setup-go@v5
3838
with:
39-
go-version: '1.21.10'
39+
go-version: '1.23.3'
4040
- name: reviewdog-golangci-lint
41-
uses: reviewdog/action-golangci-lint@v2.6.1
41+
uses: reviewdog/action-golangci-lint@v2.6.2
4242
with:
4343
go_version_file: go.mod
44-
golangci_lint_version: "v1.58.0"
44+
golangci_lint_version: "v1.62.0"
4545
golangci_lint_flags: "-c .golangci-warnings.yml --allow-parallel-runners"
4646
reporter: "github-pr-check"
4747
tool_name: "Lint Warnings"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ idb/postgres/internal/schema/setup_postgres_sql.go: idb/postgres/internal/schema
2020
cd idb/postgres/internal/schema && go generate
2121

2222
idb/mocks/IndexerDb.go: idb/idb.go
23-
go install github.com/vektra/mockery/v2@v2.20.0
23+
go install github.com/vektra/mockery/v2@v2.47.0
2424
cd idb && mockery --name=IndexerDb
2525

2626
# check that all packages (except tests) compile

api/handlers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ func (si *ServerImplementation) LookupApplicationBoxByIDAndName(ctx echo.Context
600600

601601
if len(boxes) == 0 { // this is an unexpected situation as should have received a sql.ErrNoRows from fetchApplicationBoxes's err
602602
msg := fmt.Sprintf("%s: round=?=%d, appid=%d, boxName=%s", ErrFailedLookingUpBoxes, round, applicationID, encodedBoxName)
603-
return indexerError(ctx, fmt.Errorf(msg))
603+
return indexerError(ctx, errors.New(msg))
604604
}
605605

606606
if appid != generated.ApplicationId(applicationID) {
@@ -668,7 +668,7 @@ func (si *ServerImplementation) SearchForApplicationBoxes(ctx echo.Context, appl
668668

669669
if len(boxes) == 0 { // this is an unexpected situation as should have received a sql.ErrNoRows from fetchApplicationBoxes's err
670670
msg := fmt.Sprintf("%s: round=?=%d, appid=%d", errFailedSearchingBoxes, round, applicationID)
671-
return indexerError(ctx, fmt.Errorf(msg))
671+
return indexerError(ctx, errors.New(msg))
672672
}
673673

674674
if appid != generated.ApplicationId(applicationID) {

api/handlers_e2e_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@ func TestFetchBlockWithOptions(t *testing.T) {
15311531
}
15321532

15331533
for _, tc := range testCases {
1534-
t.Run(fmt.Sprintf(tc.name), func(t *testing.T) {
1534+
t.Run(tc.name, func(t *testing.T) {
15351535
c, api, rec := setupReq("/v2/blocks/:round-number", "round-number", "1")
15361536
if tc.name == "default" {
15371537
err = api.LookupBlock(c, 1, generated.LookupBlockParams{})

api/handlers_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -992,12 +992,13 @@ func TestApplicationLimits(t *testing.T) {
992992
},
993993
}
994994

995-
// Mock backend to capture default limits
996-
mockIndexer := &mocks.IndexerDb{}
997-
si := testServerImplementation(mockIndexer)
998-
si.timeout = 5 * time.Millisecond
999-
1000995
for _, tc := range testcases {
996+
997+
// Mock backend to capture default limits
998+
mockIndexer := &mocks.IndexerDb{}
999+
si := testServerImplementation(mockIndexer)
1000+
si.timeout = 5 * time.Millisecond
1001+
10011002
t.Run(tc.name, func(t *testing.T) {
10021003
// Setup context...
10031004
e := echo.New()

config/datadir_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ func TestAlgodArgsForDataDirNetDoesNotExist(t *testing.T) {
1919
func TestAlgodArgsForDataDirTokenDoesNotExist(t *testing.T) {
2020
dir, err := os.MkdirTemp("", "datadir")
2121
if err != nil {
22-
t.Fatalf(err.Error())
22+
t.Fatal(err.Error())
2323
}
2424
err = os.WriteFile(filepath.Join(dir, "algod.net"), []byte("127.0.0.1:8080"), fs.ModePerm)
2525
if err != nil {
26-
t.Fatalf(err.Error())
26+
t.Fatal(err.Error())
2727
}
2828
defer os.RemoveAll(dir)
2929
_, _, _, err = AlgodArgsForDataDir(dir)
@@ -34,15 +34,15 @@ func TestAlgodArgsForDataDirTokenDoesNotExist(t *testing.T) {
3434
func TestAlgodArgsForDataDirSuccess(t *testing.T) {
3535
dir, err := os.MkdirTemp("", "datadir")
3636
if err != nil {
37-
t.Fatalf(err.Error())
37+
t.Fatal(err.Error())
3838
}
3939
err = os.WriteFile(filepath.Join(dir, "algod.net"), []byte("127.0.0.1:8080"), fs.ModePerm)
4040
if err != nil {
41-
t.Fatalf(err.Error())
41+
t.Fatal(err.Error())
4242
}
4343
err = os.WriteFile(filepath.Join(dir, "algod.token"), []byte("abc123"), fs.ModePerm)
4444
if err != nil {
45-
t.Fatalf(err.Error())
45+
t.Fatal(err.Error())
4646
}
4747
defer os.RemoveAll(dir)
4848
netAddr, token, lastmod, err := AlgodArgsForDataDir(dir)

e2e_tests/docker/indexer-filtered/e2e-read/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG GO_IMAGE=golang:1.21.10
1+
ARG GO_IMAGE=golang:1.23.3
22
FROM $GO_IMAGE
33

44
RUN echo "Go image: $GO_IMAGE"

0 commit comments

Comments
 (0)