Skip to content

Commit

Permalink
build: update go version to 1.19 (backport #1689) (#1693)
Browse files Browse the repository at this point in the history
Co-authored-by: Ryan Christoffersen <12519942+ryanchristo@users.noreply.github.com>
  • Loading branch information
mergify[bot] and ryanchristo authored Dec 16, 2022
1 parent ba7d09b commit fb26950
Show file tree
Hide file tree
Showing 22 changed files with 38 additions and 39 deletions.
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

0 comments on commit fb26950

Please sign in to comment.