diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 7cc33c11..b8a81411 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -41,7 +41,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.23.x" + go-version: "1.24.x" cache: false - name: Install gitlint run: | @@ -61,9 +61,9 @@ jobs: # NOTE: Using the official golangci-lint GitHub Action should give # better performance than manually installing golangci-lint and running # 'make lint-go'. - uses: golangci/golangci-lint-action@v6.1.0 + uses: golangci/golangci-lint-action@v6.5.0 with: - version: v1.61 + version: v1.64 # Always run this step so that all linting errors can be seen at once. if: always() - name: Ensure a clean code checkout diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 5b2d1559..7d1d5d15 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -29,7 +29,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.23.x" + go-version: "1.24.x" - name: Cache Go dependencies uses: actions/cache@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9dc1062f..d858380f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: "1.23.x" + go-version: "1.24.x" - name: Install GoReleaser uses: goreleaser/goreleaser-action@v5 with: diff --git a/.golangci.yml b/.golangci.yml index ea2460a9..008f7f80 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -17,7 +17,6 @@ linters: - dupl - errcheck - exhaustive - - exportloopref - goconst - gocritic - gocyclo @@ -56,6 +55,9 @@ linters-settings: - $all allow: - $gostd + - golang.org/x/sys/unix + - golang.org/x/crypto/sha3 + - golang.org/x/crypto/argon2 - github.com/oasisprotocol - github.com/btcsuite/btcd - github.com/adrg/xdg @@ -82,6 +84,3 @@ linters-settings: # Switch statements are to be considered exhaustive if a 'default' case is # present, even if all enum members aren't listed in the switch. default-signifies-exhaustive: true - govet: - # Enabled checking for shadowed variables. - check-shadowing: true diff --git a/build/rofl/artifacts.go b/build/rofl/artifacts.go index bbe7ff27..1b389401 100644 --- a/build/rofl/artifacts.go +++ b/build/rofl/artifacts.go @@ -13,7 +13,7 @@ var LatestContainerArtifacts = ArtifactsConfig{ Kernel: "https://github.com/oasisprotocol/oasis-boot/releases/download/v0.4.1/stage1.bin#06e12cba9b2423b4dd5916f4d84bf9c043f30041ab03aa74006f46ef9c129d22", Stage2: "https://github.com/oasisprotocol/oasis-boot/releases/download/v0.4.1/stage2-podman.tar.bz2#6f2487aa064460384309a58c858ffea9316e739331b5c36789bb2f61117869d6", Container: ContainerArtifactsConfig{ - Runtime: "https://github.com/oasisprotocol/oasis-sdk/releases/download/rofl-containers%2Fv0.4.2/rofl-containers#0cbaa4c0c1b35c5ed41156868bee9f3726f52eeedc01b3060d3b2eb67d76f546", + Runtime: "https://github.com/oasisprotocol/oasis-sdk/releases/download/rofl-containers%2Fv0.5.0/rofl-containers#800be74e543f1d10d12ef6fadce89dd0a0ce7bc798dbab4f8d7aa012d82fbff1", Compose: "compose.yaml", }, } diff --git a/cmd/account/show/delegations.go b/cmd/account/show/delegations.go index 798fe1b9..14d84ec2 100644 --- a/cmd/account/show/delegations.go +++ b/cmd/account/show/delegations.go @@ -24,13 +24,13 @@ const amountFieldName = "Amount:" // lenLongestString returns the length of the longest string passed to it. func lenLongestString(strs ...string) int { - max := 0 + maxLen := 0 for _, s := range strs { - if len(s) > max { - max = len(s) + if len(s) > maxLen { + maxLen = len(s) } } - return max + return maxLen } // delegationDescription is a description of a (debonding) delegation. diff --git a/config/addressbook.go b/config/addressbook.go index 76df6a72..ff8dff8d 100644 --- a/config/addressbook.go +++ b/config/addressbook.go @@ -49,25 +49,25 @@ func (ab *AddressBook) Remove(name string) error { } // Rename renames an existing address book entry. -func (ab *AddressBook) Rename(old, new string) error { - cfg, exists := ab.All[old] +func (ab *AddressBook) Rename(oldName, newName string) error { + cfg, exists := ab.All[oldName] if !exists { - return fmt.Errorf("address named '%s' does not exist in the address book", old) + return fmt.Errorf("address named '%s' does not exist in the address book", oldName) } - if _, exists = ab.All[new]; exists { - return fmt.Errorf("address named '%s' already exists in the address book", new) + if _, exists = ab.All[newName]; exists { + return fmt.Errorf("address named '%s' already exists in the address book", newName) } - if err := config.ValidateIdentifier(old); err != nil { - return fmt.Errorf("malformed old address name '%s': %w", old, err) + if err := config.ValidateIdentifier(oldName); err != nil { + return fmt.Errorf("malformed old address name '%s': %w", oldName, err) } - if err := config.ValidateIdentifier(new); err != nil { - return fmt.Errorf("malformed new address name '%s': %w", new, err) + if err := config.ValidateIdentifier(newName); err != nil { + return fmt.Errorf("malformed new address name '%s': %w", newName, err) } - ab.All[new] = cfg - delete(ab.All, old) + ab.All[newName] = cfg + delete(ab.All, oldName) return nil } diff --git a/config/wallet.go b/config/wallet.go index 2cb280e7..511f6fad 100644 --- a/config/wallet.go +++ b/config/wallet.go @@ -156,21 +156,21 @@ func (w *Wallet) Remove(name string) error { } // Rename renames an existing account. -func (w *Wallet) Rename(old, new string) error { - cfg, exists := w.All[old] +func (w *Wallet) Rename(oldName, newName string) error { + cfg, exists := w.All[oldName] if !exists { - return fmt.Errorf("account '%s' does not exist in the wallet", old) + return fmt.Errorf("account '%s' does not exist in the wallet", oldName) } - if _, exists = w.All[new]; exists { - return fmt.Errorf("account '%s' already exists in the wallet", new) + if _, exists = w.All[newName]; exists { + return fmt.Errorf("account '%s' already exists in the wallet", newName) } - if err := config.ValidateIdentifier(old); err != nil { - return fmt.Errorf("malformed old account name '%s': %w", old, err) + if err := config.ValidateIdentifier(oldName); err != nil { + return fmt.Errorf("malformed old account name '%s': %w", oldName, err) } - if err := config.ValidateIdentifier(new); err != nil { - return fmt.Errorf("malformed new account name '%s': %w", new, err) + if err := config.ValidateIdentifier(newName); err != nil { + return fmt.Errorf("malformed new account name '%s': %w", newName, err) } af, err := wallet.Load(cfg.Kind) @@ -178,16 +178,16 @@ func (w *Wallet) Rename(old, new string) error { return err } - if err := af.Rename(old, new, cfg.Config); err != nil { + if err := af.Rename(oldName, newName, cfg.Config); err != nil { return err } - w.All[new] = cfg - delete(w.All, old) + w.All[newName] = cfg + delete(w.All, oldName) // Update default if set to this wallet. - if w.Default == old { - w.Default = new + if w.Default == oldName { + w.Default = newName } return nil diff --git a/go.mod b/go.mod index 74188fde..c5bc0c43 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,8 @@ module github.com/oasisprotocol/cli -go 1.23.2 +go 1.24.0 -toolchain go1.23.5 +toolchain go1.24.2 // 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 @@ -23,8 +23,8 @@ require ( github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7 github.com/oasisprotocol/metadata-registry-tools v0.0.0-20220406100644-7e9a2b991920 - github.com/oasisprotocol/oasis-core/go v0.2500.0 - github.com/oasisprotocol/oasis-sdk/client-sdk/go v0.13.2 + github.com/oasisprotocol/oasis-core/go v0.2502.0 + github.com/oasisprotocol/oasis-sdk/client-sdk/go v0.14.0 github.com/olekukonko/tablewriter v0.0.5 github.com/opencontainers/image-spec v1.1.0 github.com/spf13/cobra v1.9.1 @@ -159,7 +159,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect golang.org/x/exp v0.0.0-20250128182459-e0ece0dbea4c // indirect - golang.org/x/net v0.34.0 // indirect + golang.org/x/net v0.38.0 // indirect golang.org/x/sync v0.12.0 // indirect golang.org/x/term v0.30.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect diff --git a/go.sum b/go.sum index 43352ca9..3a7792a4 100644 --- a/go.sum +++ b/go.sum @@ -427,10 +427,10 @@ github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7 h1:1102pQc2 github.com/oasisprotocol/deoxysii v0.0.0-20220228165953-2091330c22b7/go.mod h1:UqoUn6cHESlliMhOnKLWr+CBH+e3bazUPvFj1XZwAjs= github.com/oasisprotocol/metadata-registry-tools v0.0.0-20220406100644-7e9a2b991920 h1:rugJRYKamNl6WGBaU+b0wLQFkYcsnBr0ycX5QmB+AYU= github.com/oasisprotocol/metadata-registry-tools v0.0.0-20220406100644-7e9a2b991920/go.mod h1:MKr/giwakLyCCjSWh0W9Pbaf7rDD1K96Wr57OhNoUK0= -github.com/oasisprotocol/oasis-core/go v0.2500.0 h1:VK3bWrw+Z3Ptv1YcTHOqWCS8Io888imnYgd9aohFg4g= -github.com/oasisprotocol/oasis-core/go v0.2500.0/go.mod h1:VGnmXqzTnSjM5Ik+nMyposdUQip9UsT0ebzMA3JfcjE= -github.com/oasisprotocol/oasis-sdk/client-sdk/go v0.13.2 h1:ZjLU1nKU3R1Hl231DIWwwbK4Zs8vLixsDUqcdjKxA2A= -github.com/oasisprotocol/oasis-sdk/client-sdk/go v0.13.2/go.mod h1:cSeE0PjcOJiXFQKxUAvO/9B0PmraZQAlX6WPZN/UVoI= +github.com/oasisprotocol/oasis-core/go v0.2502.0 h1:B/qr+3HjCF8gN0MmY9Cw9hJ8Em/Lo5Ah8bIi9pgqgDY= +github.com/oasisprotocol/oasis-core/go v0.2502.0/go.mod h1:0wO1wYzDCNToNemyt/wF+1BjcrSBRyw6MJrWr7LvrJs= +github.com/oasisprotocol/oasis-sdk/client-sdk/go v0.14.0 h1:QFH193NC5AVgg024xwmOp9UXAygkL4I/HW5lyx2vlhs= +github.com/oasisprotocol/oasis-sdk/client-sdk/go v0.14.0/go.mod h1:ANKdBwpRAMKDePYb6fg6Sk+qhKpTQmrnl8PsEKrHt9M= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= @@ -729,8 +729,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= -golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= +golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= +golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= diff --git a/wallet/file/file.go b/wallet/file/file.go index 950ac36c..f45637ef 100644 --- a/wallet/file/file.go +++ b/wallet/file/file.go @@ -396,8 +396,8 @@ func (af *fileAccountFactory) Remove(name string, _ map[string]interface{}) erro return os.Remove(getAccountFilename(name)) } -func (af *fileAccountFactory) Rename(old, new string, _ map[string]interface{}) error { - return os.Rename(getAccountFilename(old), getAccountFilename(new)) +func (af *fileAccountFactory) Rename(oldName, newName string, _ map[string]interface{}) error { + return os.Rename(getAccountFilename(oldName), getAccountFilename(newName)) } func (af *fileAccountFactory) Import(name string, passphrase string, rawCfg map[string]interface{}, src *wallet.ImportSource) (wallet.Account, error) { diff --git a/wallet/wallet.go b/wallet/wallet.go index 205e2993..d9f0554d 100644 --- a/wallet/wallet.go +++ b/wallet/wallet.go @@ -97,7 +97,7 @@ type Factory interface { Remove(name string, cfg map[string]interface{}) error // Rename renames an existing account. - Rename(old, new string, cfg map[string]interface{}) error + Rename(oldName, newName string, cfg map[string]interface{}) error // Import creates a new account from imported key material. Import(name string, passphrase string, cfg map[string]interface{}, src *ImportSource) (Account, error)