Skip to content

Commit

Permalink
other(go): Bump Go to 1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko committed Mar 20, 2023
1 parent e1e9408 commit a27c55c
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 18 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/ci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
- name: Set up Go 1.18
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.18.x'
go-version: '1.20.x'
- name: Install gitlint
run: |
python -m pip install gitlint
Expand All @@ -62,8 +62,7 @@ jobs:
# 'make lint-go'.
uses: golangci/[email protected]
with:
# NOTE: The version must be specified without the patch version.
version: v1.50
version: v1.51.2
# Always run this step so that all linting errors can be seen at once.
if: always()
- name: Ensure a clean code checkout
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Go 1.18
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.18.x"
go-version: "1.20.x"
- name: Cache Go dependencies
uses: actions/cache@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.18
go-version: '1.20.x'
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
install-only: true
distribution: goreleaser
version: 1.14.1
version: 1.16.1
- name: Build and publish the next release
run: |
make release-build
Expand Down
6 changes: 3 additions & 3 deletions cmd/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"reflect"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -39,7 +39,7 @@ var (
conn, err := connection.Connect(ctx, npa.Network)
cobra.CheckErr(err)

rawTx, err := ioutil.ReadFile(filename)
rawTx, err := os.ReadFile(filename)
cobra.CheckErr(err)

tx, err := tryDecodeTx(rawTx)
Expand Down Expand Up @@ -76,7 +76,7 @@ var (
npa := common.GetNPASelection(cfg)
filename := args[0]

rawTx, err := ioutil.ReadFile(filename)
rawTx, err := os.ReadFile(filename)
cobra.CheckErr(err)

tx, err := tryDecodeTx(rawTx)
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/oasisprotocol/cli

go 1.18
go 1.19

// v1.5.0 has broken uint parsing, use a commit with the fix until the
// the maintainers merge the PR: https://github.com/spf13/cast/pull/144
Expand Down
4 changes: 2 additions & 2 deletions metadata/oasisscan.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"io"
"net/http"
"time"

Expand Down Expand Up @@ -53,7 +53,7 @@ func EntitiesFromOasisscan(ctx context.Context) (map[types.Address]*Entity, erro
if resp != nil {
defer resp.Body.Close()
}
vals, err := ioutil.ReadAll(resp.Body)
vals, err := io.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("failed to read response body: %w", err)
}
Expand Down
7 changes: 3 additions & 4 deletions wallet/file/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"

Expand Down Expand Up @@ -366,7 +365,7 @@ func (af *fileAccountFactory) Create(name string, passphrase string, rawCfg map[
if err != nil {
return nil, fmt.Errorf("failed to marshal envelope: %w", err)
}
if err := ioutil.WriteFile(getAccountFilename(name), raw, 0o600); err != nil {
if err := os.WriteFile(getAccountFilename(name), raw, 0o600); err != nil {
return nil, fmt.Errorf("failed to save state: %w", err)
}

Expand All @@ -386,7 +385,7 @@ func (af *fileAccountFactory) Load(name string, passphrase string, rawCfg map[st
}

// Load state from encrypted file.
raw, err := ioutil.ReadFile(getAccountFilename(name))
raw, err := os.ReadFile(getAccountFilename(name))
if err != nil {
return nil, fmt.Errorf("failed to load account state: %w", err)
}
Expand Down Expand Up @@ -457,7 +456,7 @@ func (af *fileAccountFactory) Import(name string, passphrase string, rawCfg map[
if err != nil {
return nil, fmt.Errorf("failed to marshal envelope: %w", err)
}
if err := ioutil.WriteFile(getAccountFilename(name), raw, 0o600); err != nil {
if err := os.WriteFile(getAccountFilename(name), raw, 0o600); err != nil {
return nil, fmt.Errorf("failed to save state: %w", err)
}
return acc, nil
Expand Down

0 comments on commit a27c55c

Please sign in to comment.