Skip to content

Commit

Permalink
chore: Bump to GoLang v1.18 (sourcenetwork#721)
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
shahzadlone committed Aug 3, 2022
1 parent 4e41932 commit 64483b0
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 209 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/code-test-coverage.yml
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '1.17'
go-version: "1.18"
check-latest: true

- name: Generate full test coverage report using go-acc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/detect-change.yml
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Go environment explicitly
uses: actions/setup-go@v3
with:
go-version: "1.17"
go-version: "1.18"
check-latest: true

- name: Build dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint-then-benchmark.yml
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Setup Go environment explicitly
uses: actions/setup-go@v3
with:
go-version: "1.17"
go-version: "1.18"
check-latest: true

- name: Run the golangci-lint
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/run-tests.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Setup Go environment explicitly
uses: actions/setup-go@v3
with:
go-version: "1.17"
go-version: "1.18"
check-latest: true

- name: Build dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/start-binary.yml
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Go environment explicitly
uses: actions/setup-go@v3
with:
go-version: "1.17"
go-version: "1.18"
check-latest: true

- name: Build modules
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1

# Build stage
FROM docker.io/golang:1.17 AS BUILD
FROM docker.io/golang:1.18 AS BUILD

WORKDIR /app

Expand Down
1 change: 0 additions & 1 deletion db/fetcher/fetcher.go
Expand Up @@ -48,7 +48,6 @@ type DocumentFetcher struct {
txn datastore.Txn
spans core.Spans
order []dsq.Order
uniqueSpans map[core.Span]struct{} //nolint:structcheck,unused
curSpanIndex int

schemaFields map[uint32]client.FieldDescription
Expand Down
2 changes: 1 addition & 1 deletion go.mod
@@ -1,6 +1,6 @@
module github.com/sourcenetwork/defradb

go 1.17
go 1.18

require (
github.com/bxcodec/faker v2.0.1+incompatible
Expand Down
197 changes: 0 additions & 197 deletions go.sum

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions tools/configs/golangci.yaml
Expand Up @@ -122,12 +122,15 @@ linters:
- nolintlint
- revive
- staticcheck
- structcheck
- typecheck
- unused
- varcheck
- whitespace

# https://github.com/golangci/golangci-lint/issues/2649
# Linters below are disabled for now because of go1.18 issue above^
# - structcheck

#====================================================[ Tweaks To Fix Issues or Exclude linter(s) on Select Locations ]
issues:
# List of regexps of issue texts to exclude, empty list by default.
Expand Down Expand Up @@ -262,7 +265,7 @@ linters-settings:

gosimple:
# Select the Go version to target.
go: "1.17"
go: "1.18"
# https://staticcheck.io/docs/options#checks
checks: ["all", "-S1038"]
# Turn on all except (these are disabled):
Expand Down Expand Up @@ -328,14 +331,14 @@ linters-settings:

staticcheck:
# Select the Go version to target.
go: "1.17"
go: "1.18"
# https://staticcheck.io/docs/options#checks
checks: ["all"]


unused:
# Select the Go version to target.
go: "1.17"
go: "1.18"


whitespace:
Expand Down

0 comments on commit 64483b0

Please sign in to comment.