Skip to content

Commit 64483b0

Browse files
authored
chore: Bump to GoLang v1.18 (sourcenetwork#721)
- Resolves sourcenetwork#720 - Description > Bumps Go versions of GitHub Action environment setups. > Bumps Docker image Go version. > Bumps and resolves Linter issues. > Bumps and Updates `go.mod`. - Limitation > A sub-linter was disabled because it lacked support with `v1.18` of Go. Can be easily turned back on if they bump up their support (golangci/golangci-lint#2649). > Despite us bumping to 1.18, we internally ban the use of generics until our benchmarks are fixed.
1 parent 4e41932 commit 64483b0

File tree

10 files changed

+14
-209
lines changed

10 files changed

+14
-209
lines changed

.github/workflows/code-test-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup Go
1818
uses: actions/setup-go@v3
1919
with:
20-
go-version: '1.17'
20+
go-version: "1.18"
2121
check-latest: true
2222

2323
- name: Generate full test coverage report using go-acc

.github/workflows/detect-change.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup Go environment explicitly
2424
uses: actions/setup-go@v3
2525
with:
26-
go-version: "1.17"
26+
go-version: "1.18"
2727
check-latest: true
2828

2929
- name: Build dependencies

.github/workflows/lint-then-benchmark.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Setup Go environment explicitly
4040
uses: actions/setup-go@v3
4141
with:
42-
go-version: "1.17"
42+
go-version: "1.18"
4343
check-latest: true
4444

4545
- name: Run the golangci-lint

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup Go environment explicitly
1616
uses: actions/setup-go@v3
1717
with:
18-
go-version: "1.17"
18+
go-version: "1.18"
1919
check-latest: true
2020

2121
- name: Build dependencies

.github/workflows/start-binary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Setup Go environment explicitly
2525
uses: actions/setup-go@v3
2626
with:
27-
go-version: "1.17"
27+
go-version: "1.18"
2828
check-latest: true
2929

3030
- name: Build modules

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# syntax=docker/dockerfile:1
22

33
# Build stage
4-
FROM docker.io/golang:1.17 AS BUILD
4+
FROM docker.io/golang:1.18 AS BUILD
55

66
WORKDIR /app
77

db/fetcher/fetcher.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ type DocumentFetcher struct {
4848
txn datastore.Txn
4949
spans core.Spans
5050
order []dsq.Order
51-
uniqueSpans map[core.Span]struct{} //nolint:structcheck,unused
5251
curSpanIndex int
5352

5453
schemaFields map[uint32]client.FieldDescription

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/sourcenetwork/defradb
22

3-
go 1.17
3+
go 1.18
44

55
require (
66
github.com/bxcodec/faker v2.0.1+incompatible

go.sum

Lines changed: 0 additions & 197 deletions
Large diffs are not rendered by default.

tools/configs/golangci.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,15 @@ linters:
122122
- nolintlint
123123
- revive
124124
- staticcheck
125-
- structcheck
126125
- typecheck
127126
- unused
128127
- varcheck
129128
- whitespace
130129

130+
# https://github.com/golangci/golangci-lint/issues/2649
131+
# Linters below are disabled for now because of go1.18 issue above^
132+
# - structcheck
133+
131134
#====================================================[ Tweaks To Fix Issues or Exclude linter(s) on Select Locations ]
132135
issues:
133136
# List of regexps of issue texts to exclude, empty list by default.
@@ -262,7 +265,7 @@ linters-settings:
262265

263266
gosimple:
264267
# Select the Go version to target.
265-
go: "1.17"
268+
go: "1.18"
266269
# https://staticcheck.io/docs/options#checks
267270
checks: ["all", "-S1038"]
268271
# Turn on all except (these are disabled):
@@ -328,14 +331,14 @@ linters-settings:
328331

329332
staticcheck:
330333
# Select the Go version to target.
331-
go: "1.17"
334+
go: "1.18"
332335
# https://staticcheck.io/docs/options#checks
333336
checks: ["all"]
334337

335338

336339
unused:
337340
# Select the Go version to target.
338-
go: "1.17"
341+
go: "1.18"
339342

340343

341344
whitespace:

0 commit comments

Comments
 (0)