Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Go version to 1.20 #4563

Merged
merged 8 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: "1.19"
go-version: "1.20"
cache: true

- name: Build relic
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.19'
go-version: "1.20"
- name: Checkout repo
uses: actions/checkout@v2
- name: Build relic
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
- 'v[0-9]+.[0-9]+'

env:
GO_VERSION: 1.19
GO_VERSION: "1.20"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.49
version: v1.51
args: -v --build-tags relic
working-directory: ${{ matrix.dir }}
# https://github.com/golangci/golangci-lint-action/issues/244
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/flaky-test-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- '**/*flaky-test-debug*'
env:
GO_VERSION: 1.19
GO_VERSION: "1.20"

#concurrency:
# group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.49
version: v1.51
args: -v --build-tags relic
working-directory: ${{ matrix.dir }}
# https://github.com/golangci/golangci-lint-action/issues/244
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-monitor-flaky.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
env:
BIGQUERY_DATASET: production_src_flow_test_metrics
BIGQUERY_TABLE: test_results
GO_VERSION: 1.19
GO_VERSION: "1.20"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-monitor-regular-skipped.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:
BIGQUERY_DATASET: production_src_flow_test_metrics
BIGQUERY_TABLE: skipped_tests
BIGQUERY_TABLE2: test_results
GO_VERSION: 1.19
GO_VERSION: "1.20"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.19'
go-version: "1.20"
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions cmd/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

####################################
## (1) Setup the build environment
FROM golang:1.19-bullseye AS build-setup
FROM golang:1.20-bullseye AS build-setup

RUN apt-get update
RUN apt-get -y install cmake zip
Expand Down Expand Up @@ -71,7 +71,7 @@ RUN --mount=type=ssh \
RUN chmod a+x /app/app

## (4) Add the statically linked debug binary to a distroless image configured for debugging
FROM golang:1.19-bullseye as debug
FROM golang:1.20-bullseye as debug

RUN go install github.com/go-delve/delve/cmd/dlv@latest

Expand Down
2 changes: 1 addition & 1 deletion cmd/testclient/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/onflow/flow-go/cmd/testclient

go 1.19
go 1.20

require (
github.com/onflow/flow-go-sdk v0.4.1
Expand Down
2 changes: 1 addition & 1 deletion crypto/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gcr.io/dl-flow/golang-cmake

FROM golang:1.19-buster
FROM golang:1.20-buster
RUN apt-get update
RUN apt-get -y install cmake zip
RUN go install github.com/axw/gocov/gocov@latest
Expand Down
2 changes: 1 addition & 1 deletion crypto/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/onflow/flow-go/crypto

go 1.19
go 1.20

require (
github.com/btcsuite/btcd/btcec/v2 v2.2.1
Expand Down
3 changes: 0 additions & 3 deletions engine/access/state_stream/backend_executiondata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package state_stream
import (
"context"
"fmt"
"math/rand"
"testing"
"time"

Expand Down Expand Up @@ -65,8 +64,6 @@ func TestBackendExecutionDataSuite(t *testing.T) {
}

func (s *BackendExecutionDataSuite) SetupTest() {
rand.Seed(time.Now().UnixNano())

logger := unittest.Logger()

s.state = protocolmock.NewState(s.T())
Expand Down
2 changes: 1 addition & 1 deletion fvm/crypto/hash_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package crypto_test

import (
"math/rand"
"crypto/rand"
"testing"

"crypto/sha256"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/onflow/flow-go

go 1.19
go 1.20

require (
cloud.google.com/go/compute/metadata v0.2.3
Expand Down
2 changes: 1 addition & 1 deletion insecure/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/onflow/flow-go/insecure

go 1.19
go 1.20

require (
github.com/golang/protobuf v1.5.3
Expand Down
2 changes: 1 addition & 1 deletion integration/benchmark/cmd/manual/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax = docker/dockerfile:experimental
# NOTE: Must be run in the context of the repo's root directory

FROM golang:1.19-buster AS build-setup
FROM golang:1.20-buster AS build-setup

RUN apt-get update
RUN apt-get -y install cmake zip
Expand Down
2 changes: 1 addition & 1 deletion integration/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/onflow/flow-go/integration

go 1.19
go 1.20

require (
cloud.google.com/go/bigquery v1.50.0
Expand Down
2 changes: 1 addition & 1 deletion ledger/common/testutils/testutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func RandomValues(n int, minByteSize, maxByteSize int) []l.Value {
byteSize = minByteSize + rand.Intn(maxByteSize-minByteSize)
}
value := make([]byte, byteSize)
_, err := rand.Read(value)
_, err := crand.Read(value)
if err != nil {
panic("random generation failed")
}
Expand Down
10 changes: 1 addition & 9 deletions utils/unittest/fixtures.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import (
"testing"
"time"

blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"github.com/libp2p/go-libp2p/core/peer"
"github.com/stretchr/testify/require"

Expand Down Expand Up @@ -415,12 +413,6 @@ func BlockHeaderFixture(opts ...func(header *flow.Header)) *flow.Header {
return header
}

func CidFixture() cid.Cid {
data := make([]byte, 1024)
_, _ = rand.Read(data)
return blocks.NewBlock(data).Cid()
}

func BlockHeaderFixtureOnChain(
chainID flow.ChainID,
opts ...func(header *flow.Header),
Expand Down Expand Up @@ -2451,7 +2443,7 @@ func ChunkExecutionDataFixture(t *testing.T, minSize int, opts ...func(*executio
}

v := make([]byte, size)
_, err := rand.Read(v)
_, err := crand.Read(v)
require.NoError(t, err)

k, err := ced.TrieUpdate.Payloads[0].Key()
Expand Down