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

build: update go version to 1.19 #1689

Merged
merged 4 commits into from
Dec 16, 2022
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#1244](https://github.com/regen-network/regen-ledger/pull/1244) Update all modules to Cosmos SDK v0.46
- [#1479](https://github.com/regen-network/regen-ledger/pull/1479) Update ORM tables from v1alpha1 to v1
- [#1579](https://github.com/regen-network/regen-ledger/pull/1579) Update all modules to use `errors` module
- [#1689](https://github.com/regen-network/regen-ledger/pull/1689) Update all modules to Go `1.19`

### app

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ install: go.sum go-version
GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
GO_MINOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
MIN_GO_MAJOR_VERSION = 1
MIN_GO_MINOR_VERSION = 18
MIN_GO_MINOR_VERSION = 19
GO_VERSION_ERROR = Golang version $(GO_MAJOR_VERSION).$(GO_MINOR_VERSION) is not supported, \
please update to at least $(MIN_GO_MAJOR_VERSION).$(MIN_GO_MINOR_VERSION)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Contributions are more than welcome and greatly appreciated. All the information

- [Git](https://git-scm.com) `>=2`
- [Make](https://www.gnu.org/software/make/) `>=4`
- [Go](https://golang.org/) `>=1.18`
- [Go](https://golang.org/) `>=1.19`

### Go Tools

Expand Down
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/regen-network/regen-ledger/api/v2

go 1.18
go 1.19

require (
github.com/cosmos/cosmos-proto v1.0.0-beta.1
Expand Down
8 changes: 3 additions & 5 deletions app/client/cli/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli_test

import (
"fmt"
"io/ioutil"
"os"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -15,16 +15,14 @@ import (
)

func TestInitCmd(t *testing.T) {
nodeHome, err := ioutil.TempDir(t.TempDir(), ".regen")
require.NoError(t, err)

nodeHome := os.TempDir()
rootCmd, _ := cli.NewRootCmd()
rootCmd.SetArgs([]string{
"init", // Test the init cmd
"regenapp-test", // Moniker
fmt.Sprintf("--%s=%s", flags.FlagHome, nodeHome), // Set home flag
})

err = cmd.Execute(rootCmd, app.EnvPrefix, app.DefaultNodeHome)
err := cmd.Execute(rootCmd, app.EnvPrefix, app.DefaultNodeHome)
require.NoError(t, err)
}
4 changes: 2 additions & 2 deletions app/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package app

import (
"encoding/json"
"io/ioutil"
"os"

"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/types/module"
Expand All @@ -18,7 +18,7 @@ func SimulationOperations(app *RegenApp, cdc codec.Codec, config simulation.Conf
}

if config.ParamsFile != "" {
bz, err := ioutil.ReadFile(config.ParamsFile)
bz, err := os.ReadFile(config.ParamsFile)
if err != nil {
panic(err)
}
Expand Down
2 changes: 1 addition & 1 deletion docs/ledger/get-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ In order to build the `regen` binary from source, you'll need the following:

- [Git](https://git-scm.com) `>=2` .
- [Make](https://www.gnu.org/software/make/) `>=4`
- [Go](https://golang.org/) `>=1.18`
- [Go](https://golang.org/) `>=1.19`

### Go Environment

Expand Down
8 changes: 4 additions & 4 deletions docs/validators/get-started/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,25 @@ sudo apt install git build-essential wget jq -y
Download Go:

```bash
wget https://dl.google.com/go/go1.18.4.linux-amd64.tar.gz
wget https://dl.google.com/go/go1.19.4.linux-amd64.tar.gz
```

Verify data integrity:

```bash
sha256sum go1.18.4.linux-amd64.tar.gz
sha256sum go1.19.4.linux-amd64.tar.gz
```

Verify SHA-256 hash:

```bash
c9b099b68d93f5c5c8a8844a89f8db07eaa58270e3a1e01804f17f4cf8df02f5
9df122d6baf6f2275270306b92af3b09d7973fb1259257e284dba33c0db14f1b
```

Unpack Go download:

```bash
sudo tar -C /usr/local -xzf go1.18.4.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.19.4.linux-amd64.tar.gz
```

Set up environment:
Expand Down
2 changes: 1 addition & 1 deletion docs/validators/upgrades/v5.0-upgrade.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gasFee="0.0025regen" \

### Update Go

**Go `1.18` or later is required.**
**Go `1.19` or later is required.**

For available downloads, see [Go Downloads](https://go.dev/dl/).

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/regen-network/regen-ledger/v5

go 1.18
go 1.19

require (
cosmossdk.io/math v1.0.0-beta.4
Expand Down
2 changes: 1 addition & 1 deletion images/regen-env/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18-alpine AS build
FROM golang:1.19-alpine AS build
RUN apk add build-base git linux-headers
WORKDIR /work

Expand Down
2 changes: 1 addition & 1 deletion images/regen-sandbox/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18-alpine AS build
FROM golang:1.19-alpine AS build

RUN apk -U upgrade
RUN apk add build-base git linux-headers
Expand Down
2 changes: 1 addition & 1 deletion types/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/regen-network/regen-ledger/types/v2

go 1.18
go 1.19

require (
cosmossdk.io/errors v1.0.0-beta.7
Expand Down
4 changes: 2 additions & 2 deletions types/testutil/network/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package network

import (
"encoding/json"
"io/ioutil"
"os"
"path/filepath"
"time"

Expand Down Expand Up @@ -200,7 +200,7 @@ func writeFile(name string, dir string, contents []byte) error {
return err
}

err = ioutil.WriteFile(file, contents, 0o644) //nolint: gosec
err = os.WriteFile(file, contents, 0o644) //nolint: gosec
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions x/data/client/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package client

import (
"fmt"
"io/ioutil"
"net/url"
"os"
"strconv"
"strings"

Expand Down Expand Up @@ -231,7 +231,7 @@ func parseContentHashes(clientCtx client.Context, filePath string) ([]*data.Cont
return nil, fmt.Errorf("file path is empty")
}

bz, err := ioutil.ReadFile(filePath)
bz, err := os.ReadFile(filePath)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions x/data/client/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package client

import (
"fmt"
"io/ioutil"
"os"
"strings"

"github.com/gogo/protobuf/proto"
Expand Down Expand Up @@ -41,7 +41,7 @@ func parseContentHash(clientCtx client.Context, filePath string) (*data.ContentH
return nil, fmt.Errorf("file path is empty")
}

bz, err := ioutil.ReadFile(filePath)
bz, err := os.ReadFile(filePath)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion x/data/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/regen-network/regen-ledger/x/data/v2

go 1.18
go 1.19

require (
cosmossdk.io/errors v1.0.0-beta.7
Expand Down
8 changes: 4 additions & 4 deletions x/ecocredit/base/client/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package client
import (
"bytes"
"encoding/json"
"io/ioutil"
"os"

"github.com/gogo/protobuf/proto"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -42,7 +42,7 @@ func mkQueryClient(cmd *cobra.Command) (types.QueryClient, sdkclient.Context, er
}

func parseMsgCreateBatch(clientCtx sdkclient.Context, jsonFile string) (*types.MsgCreateBatch, error) {
bz, err := ioutil.ReadFile(jsonFile)
bz, err := os.ReadFile(jsonFile)
if err != nil {
return nil, err
}
Expand All @@ -61,7 +61,7 @@ func parseMsgCreateBatch(clientCtx sdkclient.Context, jsonFile string) (*types.M
}

func parseCredits(jsonFile string) ([]*types.Credits, error) {
bz, err := ioutil.ReadFile(jsonFile)
bz, err := os.ReadFile(jsonFile)
if err != nil {
return nil, err
}
Expand All @@ -82,7 +82,7 @@ func parseCredits(jsonFile string) ([]*types.Credits, error) {
}

func parseSendCredits(jsonFile string) ([]*types.MsgSend_SendCredits, error) {
bz, err := ioutil.ReadFile(jsonFile)
bz, err := os.ReadFile(jsonFile)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions x/ecocredit/basket/client/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package client
import (
"bytes"
"encoding/json"
"io/ioutil"
"os"

"github.com/spf13/cobra"

Expand All @@ -20,7 +20,7 @@ func txFlags(cmd *cobra.Command) *cobra.Command {
}

func parseBasketCredits(creditsFile string) ([]*types.BasketCredit, error) {
bz, err := ioutil.ReadFile(creditsFile)
bz, err := os.ReadFile(creditsFile)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion x/ecocredit/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/regen-network/regen-ledger/x/ecocredit/v3

go 1.18
go 1.19

require (
cosmossdk.io/errors v1.0.0-beta.7
Expand Down
8 changes: 4 additions & 4 deletions x/ecocredit/marketplace/client/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package client
import (
"bytes"
"encoding/json"
"io/ioutil"
"os"

"github.com/spf13/cobra"

Expand All @@ -20,7 +20,7 @@ func txFlags(cmd *cobra.Command) *cobra.Command {
}

func parseSellOrders(jsonFile string) ([]*types.MsgSell_Order, error) {
bz, err := ioutil.ReadFile(jsonFile)
bz, err := os.ReadFile(jsonFile)
if err != nil {
return nil, err
}
Expand All @@ -41,7 +41,7 @@ func parseSellOrders(jsonFile string) ([]*types.MsgSell_Order, error) {
}

func parseSellUpdates(jsonFile string) ([]*types.MsgUpdateSellOrders_Update, error) {
bz, err := ioutil.ReadFile(jsonFile)
bz, err := os.ReadFile(jsonFile)
if err != nil {
return nil, err
}
Expand All @@ -62,7 +62,7 @@ func parseSellUpdates(jsonFile string) ([]*types.MsgUpdateSellOrders_Update, err
}

func parseBuyOrders(jsonFile string) ([]*types.MsgBuyDirect_Order, error) {
bz, err := ioutil.ReadFile(jsonFile)
bz, err := os.ReadFile(jsonFile)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion x/intertx/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/regen-network/regen-ledger/x/intertx

go 1.18
go 1.19

require (
cosmossdk.io/errors v1.0.0-beta.7
Expand Down