Skip to content

Commit

Permalink
Merge pull request #557 from oasisprotocol/mitjat/fix-imports--chainhash
Browse files Browse the repository at this point in the history
Bump Go (1.21.3), golangci-lint (1.55.1)
  • Loading branch information
mitjat authored Nov 3, 2023
2 parents e4f3b28 + dc6178b commit fe976c3
Show file tree
Hide file tree
Showing 16 changed files with 152 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
# Always run this step so that all linting errors can be seen at once.
if: always()
- name: Autogenerate Go code
Expand All @@ -49,6 +49,6 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
# Update README.md instructions when bumping this.
version: v1.49.0
version: v1.55.1
# Always run this step so that all linting errors can be seen at once.
if: always()
12 changes: 9 additions & 3 deletions .github/workflows/ci-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,19 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21.3
- name: Install Go tools
run: go install github.com/deepmap/oapi-codegen/cmd/[email protected]
- name: Build Go
run: |
make nexus
make test-ci
- name: Ensure dependencies are tidied up
# NOTE: This should run _after_ the build step, so that oapi-codegen has already run
# and generated the Go code that points to some of the dependencies.
run: |
go mod tidy -v -x -compat=1.21 # goreleaser does the same; can find lingering issues
echo TIDY RESULTS START; git diff || true; echo TIDY RESULTS END
- name: Upload to codecov.io
uses: codecov/[email protected]
with:
Expand Down Expand Up @@ -87,7 +93,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- name: Autogenerate Go code
run: |
go install github.com/deepmap/oapi-codegen/cmd/[email protected]
Expand Down Expand Up @@ -123,7 +129,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- name: Autogenerate Go code
run: |
go install github.com/deepmap/oapi-codegen/cmd/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/[email protected]
with:
go-version: 1.19
go-version: 1.21
- name: Install Go tools
run: go install github.com/deepmap/oapi-codegen/cmd/[email protected]

Expand Down
5 changes: 4 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ issues:
- govet
- linters: [revive]
text: var-naming # do not demand that `Id` always be spelled `ID`; messes with autogenerated code
- linters: [structcheck]
text: is unused # linter has false positives; claims that fields are unused even though they're not
- linters: [revive]
text: stutters
- linters: [revive]
text: unused-parameter # it's fine to have unused func parameters that are not named `_`; they're usually there because the function is part of an interface
- linters: [stylecheck]
text: ST1003 # do not demand that `Id` always be spelled `ID`; messes with autogenerated code

Expand All @@ -30,7 +34,6 @@ linters:
- asciicheck
- bodyclose
- deadcode
- depguard
- dogsled
- errcheck
- exhaustive
Expand Down
2 changes: 1 addition & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ project_name: Oasis Nexus

before:
hooks:
- go mod tidy -compat=1.19
- go mod tidy -compat=1.21

builds:
- binary: nexus
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Here are our recommendations for getting the tools that `make lint` and `make fm
They explain that the tool is in dependency hell and any more structured distribution of it might not work.

```sh
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.55.1
```

**gofumpt**: [go install](https://pkg.go.dev/mvdan.cc/gofumpt)
Expand Down
1 change: 1 addition & 0 deletions analyzer/evmnfts/pubclient/pub_client_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//nolint:bodyclose // This is a test, we can be sloppy and not close HTTP request bodies.
package pubclient

import (
Expand Down
4 changes: 3 additions & 1 deletion analyzer/runtime/extract.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ func ExtractRound(blockHeader nodeapi.RuntimeBlockHeader, txrs []nodeapi.Runtime

// Extract info from transactions.
for txIndex, txr := range txrs {
txr := txr // For safe usage of `&txr` inside this long loop.
var blockTransactionData BlockTransactionData
blockTransactionData.Index = txIndex
blockTransactionData.Hash = txr.Tx.Hash().Hex()
Expand All @@ -345,6 +346,7 @@ func ExtractRound(blockHeader nodeapi.RuntimeBlockHeader, txrs []nodeapi.Runtime
if tx != nil { //nolint:nestif
blockTransactionData.SignerData = make([]*BlockTransactionSignerData, 0, len(tx.AuthInfo.SignerInfo))
for j, si := range tx.AuthInfo.SignerInfo {
si := si // we have no dangerous uses of &si, but capture the variable just in case (and to make the linter happy)
var blockTransactionSignerData BlockTransactionSignerData
blockTransactionSignerData.Index = j
addr, err1 := registerRelatedAddressSpec(blockData.AddressPreimages, blockTransactionData.RelatedAccountAddresses, &si.AddressSpec)
Expand All @@ -359,7 +361,7 @@ func ExtractRound(blockHeader nodeapi.RuntimeBlockHeader, txrs []nodeapi.Runtime
blockTransactionData.GasLimit = tx.AuthInfo.Fee.Gas

// Parse the success/error status.
if fail := txr.Result.Failed; fail != nil { //nolint:gocritic
if fail := txr.Result.Failed; fail != nil {
blockTransactionData.Success = common.Ptr(false)
blockTransactionData.Error = &TxError{
Code: fail.Code,
Expand Down
4 changes: 2 additions & 2 deletions docker/nexus/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19-buster AS nexus-builder
FROM golang:1.21-bookworm AS nexus-builder

WORKDIR /code/go

Expand All @@ -20,7 +20,7 @@ RUN npx redoc-cli build api/spec/v1.yaml -o api/spec/v1.html

############

FROM golang:1.19-buster AS nexus
FROM golang:1.21-bookworm AS nexus

WORKDIR /nexus

Expand Down
2 changes: 1 addition & 1 deletion docker/oasis-net-runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19-bookworm AS oasis-core
FROM golang:1.21-bookworm AS oasis-core

ARG OASIS_CORE_VERSION=23.0.2

Expand Down
2 changes: 1 addition & 1 deletion docker/oasis-node/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.19-bookworm AS oasis-node
FROM golang:1.21-bookworm AS oasis-node

ARG OASIS_CORE_VERSION=23.0.2

Expand Down
16 changes: 15 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/oasisprotocol/nexus

go 1.19
go 1.21

toolchain go1.21.3

replace (
github.com/cometbft/cometbft => github.com/oasisprotocol/cometbft v0.37.2-oasis1
Expand Down Expand Up @@ -39,6 +41,7 @@ require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 // indirect
github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
Expand All @@ -58,10 +61,13 @@ require (
github.com/fatih/color v1.13.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
github.com/getkin/kin-openapi v0.107.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.4.0 // indirect
github.com/go-git/go-git/v5 v5.5.2 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-openapi/jsonpointer v0.19.5 // indirect
github.com/go-openapi/swag v0.21.1 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/golang/glog v1.1.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
Expand All @@ -78,18 +84,23 @@ require (
github.com/holiman/uint256 v1.2.3 // indirect
github.com/imdario/mergo v0.3.13 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/invopop/yaml v0.1.0 // indirect
github.com/ipfs/go-cid v0.4.1 // indirect
github.com/ipfs/go-log/v2 v2.5.1 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/puddle/v2 v2.2.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/labstack/echo/v4 v4.9.1 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-libp2p v0.30.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
Expand All @@ -100,6 +111,7 @@ require (
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
Expand Down Expand Up @@ -132,6 +144,8 @@ require (
github.com/subosito/gotenv v1.4.2 // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/tidwall/btree v1.6.0 // indirect
github.com/valyala/bytebufferpool v1.0.0 // indirect
github.com/valyala/fasttemplate v1.2.2 // indirect
github.com/x448/float16 v0.8.4 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.uber.org/atomic v1.11.0 // indirect
Expand Down
Loading

0 comments on commit fe976c3

Please sign in to comment.