Skip to content

Commit

Permalink
chore: update Golang to 1.23 on feat/parachain branch (#4391)
Browse files Browse the repository at this point in the history
  • Loading branch information
EclesioMeloJunior authored Dec 9, 2024
1 parent 0d3e962 commit fb0a4b0
Show file tree
Hide file tree
Showing 26 changed files with 56 additions and 32 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23.2"
stable: true
check-latest: true

Expand Down Expand Up @@ -67,7 +67,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23.2"
stable: true
check-latest: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23.2"
stable: true
check-latest: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/copyright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23.2"
stable: true
check-latest: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23.2"
stable: true
check-latest: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23.2"
stable: true
check-latest: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23.2"
stable: true
check-latest: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mocks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23.2"
stable: true
check-latest: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23.2"
stable: true
check-latest: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/zombienet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version: "1.23.2"
stable: true
check-latest: true

Expand Down
34 changes: 28 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ run:
build-tags:
- integration

skip-files:
- .*mock_.*\.go
- .*mocks\/.*\.go

linters-settings:
govet:
# report about shadowed variables
check-shadowing: true
shadow: true
excludes:
- printf

revive:
severity: warning
Expand All @@ -33,6 +31,17 @@ linters-settings:
- map
- chan

gosec:
excludes:
- G115
- G301
- G306

gosimple:
excludes:
- S1009


misspell:
locale: UK
ignore-words:
Expand All @@ -41,12 +50,12 @@ linters-settings:
- finalized
- finalize
- initialize
- color

linters:
enable:
- bodyclose
- errcheck
- exportloopref
- goconst
- gocyclo
- gofmt
Expand All @@ -68,8 +77,13 @@ linters:
- unparam
- usestdlibvars
- unused
disable:
- typecheck

issues:
exclude-files:
- .*mock_.*\.go
- .*mocks\/.*\.go
exclude-rules:
- path: _test\.go
linters:
Expand All @@ -95,6 +109,14 @@ issues:
linters:
- govet

- text: 'printf: non-constant format*'
linters:
- govet

- text: 'return both a `nil` error and an invalid value*'
linters:
- nilnil

- linters:
- revive
text: "package comment should be of the form"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG DEBIAN_VERSION=bullseye-slim
ARG GO_VERSION=1.21.1-bullseye
ARG GO_VERSION=1.23.2-bullseye

FROM golang:${GO_VERSION} AS builder

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.staging
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22
FROM golang:1.23

ARG chain="polkadot"
ARG basepath="~/.local/share/gossamer"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ help: Makefile

.PHONY: lint
lint:
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.54
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.62
golangci-lint run

clean:
Expand Down
2 changes: 1 addition & 1 deletion devnet/alice.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2021 ChainSafe Systems (ON)
# SPDX-License-Identifier: LGPL-3.0-only

FROM golang:1.20
FROM golang:1.23

ARG DD_API_KEY=somekey
ARG CHAIN=westend-local
Expand Down
2 changes: 1 addition & 1 deletion devnet/bob.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2021 ChainSafe Systems (ON)
# SPDX-License-Identifier: LGPL-3.0-only

FROM golang:1.20
FROM golang:1.23

ARG DD_API_KEY=somekey
ARG CHAIN=westend-local
Expand Down
2 changes: 1 addition & 1 deletion devnet/substrate_alice.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

ARG POLKADOT_VERSION=v0.9.37

FROM golang:1.20 as openmetrics
FROM golang:1.23 as openmetrics
ARG METRICS_NAMESPACE=substrate.local.devnet

WORKDIR /devnet
Expand Down
2 changes: 1 addition & 1 deletion devnet/substrate_bob.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

ARG POLKADOT_VERSION=v0.9.37

FROM golang:1.20 as openmetrics
FROM golang:1.23 as openmetrics

ARG METRICS_NAMESPACE=substrate.local.devnet

Expand Down
2 changes: 1 addition & 1 deletion dot/parachain/backing/per_relay_parent_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ func (rpState *perRelayParentState) validateAndMakeAvailable(
bgValidationResult = backgroundValidationResult{
outputs: nil,
candidate: &candidateReceipt,
err: fmt.Errorf(validationResultRes.Data.Invalid.Error()),
err: validationResultRes.Data.Invalid,
}
}

Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,9 @@ require (
lukechampine.com/blake3 v1.2.1 // indirect
)

go 1.21
go 1.23

toolchain go1.23.2

replace github.com/tetratelabs/wazero => github.com/ChainSafe/wazero v0.0.0-20240319130522-78b21a59bd5f

Expand Down
2 changes: 1 addition & 1 deletion internal/log/level.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strconv"
"strings"

"github.com/fatih/color" //nolint:misspell
"github.com/fatih/color"
)

// Level is the level of the logger.
Expand Down
2 changes: 1 addition & 1 deletion internal/log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"time"

"github.com/fatih/color" //nolint:misspell
"github.com/fatih/color"
)

func (l *Logger) log(logLevel Level, s string, args ...interface{}) {
Expand Down
2 changes: 1 addition & 1 deletion lib/blocktree/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func (n *node) getLeaves(leaves []*node) []*node {
leaves = []*node{}
}

if n.children == nil || len(n.children) == 0 {
if len(n.children) == 0 {
leaves = append(leaves, n)
}

Expand Down
2 changes: 1 addition & 1 deletion lib/runtime/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const (
// ParachainHostValidationCodeByHash returns parachain host's validation code by hash
ParachainHostValidationCodeByHash = "ParachainHost_validation_code_by_hash"
// ParachainHostValidators is the runtime API call ParachainHost_validators
ParachainHostValidators = "ParachainHost_validators" //nolint
ParachainHostValidators = "ParachainHost_validators"
// ParachainHostValidatorGroups is the runtime API call ParachainHost_validator_groups
ParachainHostValidatorGroups = "ParachainHost_validator_groups"
// ParachainHostAvailabilityCores is the runtime API call ParachainHost_availability_cores
Expand Down
2 changes: 1 addition & 1 deletion pkg/scale/decode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func Test_unmarshal_optionality_nil_case(t *testing.T) {

temp := reflect.New(reflect.TypeOf(t.in))
// create a new pointer to type of temp
tempv := reflect.New(reflect.PtrTo(temp.Type()).Elem())
tempv := reflect.New(reflect.PointerTo(temp.Type()).Elem())
// set zero value to elem of **temp so that is nil
tempv.Elem().Set(reflect.Zero(tempv.Elem().Type()))
// set test.in to *temp
Expand Down
2 changes: 1 addition & 1 deletion pkg/scale/encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ func Test_marshal_optionality_nil_cases(t *testing.T) {
// create a new pointer to new zero value of t.in
temp := reflect.New(reflect.TypeOf(t.in))
// create a new pointer to type of temp
tempv := reflect.New(reflect.PtrTo(temp.Type()).Elem())
tempv := reflect.New(reflect.PointerTo(temp.Type()).Elem())
// set zero value to elem of **temp so that is nil
tempv.Elem().Set(reflect.Zero(tempv.Elem().Type()))
// set test.in to *temp
Expand Down
2 changes: 1 addition & 1 deletion pkg/trie/triedb/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func newNodeFromEncoded(nodeHash common.Hash, data []byte, storage NodeStorage)
}
return newChild, nil
}
return nil, nil //nolint:nilnil
return nil, nil
}

children := [codec.ChildrenCapacity]NodeHandle{}
Expand Down

0 comments on commit fb0a4b0

Please sign in to comment.