Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Aug 14, 2024
1 parent 0a10db9 commit 0ad4295
Show file tree
Hide file tree
Showing 45 changed files with 49 additions and 47 deletions.
2 changes: 1 addition & 1 deletion client/v2/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/client/v2

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion collections/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/collections

go 1.23.0
go 1.23

require (
cosmossdk.io/core v1.0.0
Expand Down
2 changes: 1 addition & 1 deletion core/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module cosmossdk.io/core
// Core is meant to have zero dependencies, so we can use it as a dependency
// in other modules without having to worry about circular dependencies.

go 1.23.0
go 1.23

// Version tagged too early and incompatible with v0.50 (latest at the time of tagging)
retract v0.12.0
2 changes: 1 addition & 1 deletion core/testing/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/core/testing

go 1.23.0
go 1.23

replace cosmossdk.io/core => ../

Expand Down
4 changes: 2 additions & 2 deletions crypto/armor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestArmorUnarmorPrivKey(t *testing.T) {
// empty string
decrypted, algo, err = crypto.UnarmorDecryptPrivKey("", "passphrase")
require.Error(t, err)
require.True(t, errors.Is(io.EOF, err))
require.True(t, errors.Is(err, io.EOF))
require.Nil(t, decrypted)
require.Empty(t, algo)

Expand Down Expand Up @@ -165,7 +165,7 @@ func TestArmorInfoBytes(t *testing.T) {
func TestUnarmorInfoBytesErrors(t *testing.T) {
unarmoredBytes, err := crypto.UnarmorInfoBytes("")
require.Error(t, err)
require.True(t, errors.Is(io.EOF, err))
require.True(t, errors.Is(err, io.EOF))
require.Nil(t, unarmoredBytes)

header := map[string]string{
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.23.0
go 1.23

module github.com/cosmos/cosmos-sdk

Expand Down
2 changes: 1 addition & 1 deletion go.work.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.23.0
go 1.23

use (
.
Expand Down
2 changes: 1 addition & 1 deletion indexer/postgres/tests/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/indexer/postgres/testing

go 1.23.0
go 1.23

require (
cosmossdk.io/indexer/postgres v0.0.0-00010101000000-000000000000
Expand Down
2 changes: 1 addition & 1 deletion orm/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/orm

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion runtime/v2/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/runtime/v2

go 1.23.0
go 1.23

// server v2 integration
replace (
Expand Down
2 changes: 1 addition & 1 deletion schema/testing/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/schema/testing

go 1.23.0
go 1.23

require (
cosmossdk.io/schema v0.0.0
Expand Down
2 changes: 1 addition & 1 deletion server/v2/appmanager/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/server/v2/appmanager

go 1.23.0
go 1.23

replace cosmossdk.io/core => ../../../core

Expand Down
2 changes: 1 addition & 1 deletion server/v2/cometbft/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/server/v2/cometbft

go 1.23.0
go 1.23

replace (
cosmossdk.io/api => ../../../api
Expand Down
2 changes: 1 addition & 1 deletion server/v2/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/server/v2

go 1.23.0
go 1.23

replace (
cosmossdk.io/api => ../../api
Expand Down
2 changes: 1 addition & 1 deletion server/v2/stf/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/server/v2/stf

go 1.23.0
go 1.23

replace cosmossdk.io/core => ../../../core

Expand Down
2 changes: 1 addition & 1 deletion simapp/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/simapp

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion simapp/v2/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/simapp/v2

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion store/v2/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/store/v2

go 1.23.0
go 1.23

require (
cosmossdk.io/core v1.0.0
Expand Down
2 changes: 1 addition & 1 deletion tests/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cosmos/cosmos-sdk/tests

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion tests/systemtests/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/tests/systemtests

go 1.23.0
go 1.23

require (
github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect
Expand Down
2 changes: 1 addition & 1 deletion tools/confix/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/tools/confix

go 1.23.0
go 1.23

require (
github.com/cosmos/cosmos-sdk v0.50.9
Expand Down
2 changes: 1 addition & 1 deletion tools/cosmovisor/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/tools/cosmovisor

go 1.23.0
go 1.23

require (
cosmossdk.io/log v1.4.0
Expand Down
6 changes: 4 additions & 2 deletions types/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ func (s *contextTestSuite) TestContextWithCustom() {
s.Require().Equal(cp, ctx.WithConsensusParams(cp).ConsensusParams())

// test inner context
newContext := context.WithValue(ctx.Context(), struct{}{}, "value")
var ctxKey = struct{}{}
newContext := context.WithValue(ctx.Context(), ctxKey, "value")

Check failure on line 141 in types/context_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

SA1029: should not use empty anonymous struct as key for value; define your own type to avoid collisions (staticcheck)
s.Require().NotEqual(ctx.Context(), ctx.WithContext(newContext).Context())
}

Expand Down Expand Up @@ -225,7 +226,8 @@ func (s *contextTestSuite) TestUnwrapSDKContext() {
s.Require().Panics(func() { types.UnwrapSDKContext(ctx) })

// test unwrapping when we've used context.WithValue
ctx = context.WithValue(sdkCtx, struct{}{}, "bar")
var ctxKey = struct{}{}
ctx = context.WithValue(sdkCtx, ctxKey, "bar")

Check failure on line 230 in types/context_test.go

View workflow job for this annotation

GitHub Actions / golangci-lint

SA1029: should not use empty anonymous struct as key for value; define your own type to avoid collisions (staticcheck)
sdkCtx2 = types.UnwrapSDKContext(ctx)
s.Require().Equal(sdkCtx, sdkCtx2)
}
2 changes: 1 addition & 1 deletion x/accounts/defaults/lockup/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/accounts/defaults/lockup

go 1.23.0
go 1.23

require (
cosmossdk.io/collections v0.4.0
Expand Down
2 changes: 1 addition & 1 deletion x/accounts/defaults/multisig/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/accounts/defaults/multisig

go 1.23.0
go 1.23

require (
cosmossdk.io/collections v0.4.0
Expand Down
2 changes: 1 addition & 1 deletion x/accounts/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/accounts

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/auth/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/auth

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/authz/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/authz

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/bank/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/bank

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/circuit/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/circuit

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/consensus/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/consensus

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/distribution/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/distribution

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/epochs/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/epochs

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/evidence/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/evidence

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/feegrant/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/feegrant

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/gov/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/gov

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/group/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/group

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/mint/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/mint

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/nft/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/nft

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/params/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/params

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/protocolpool/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/protocolpool

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/slashing/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/slashing

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/staking/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/staking

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/tx/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/tx

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down
2 changes: 1 addition & 1 deletion x/upgrade/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module cosmossdk.io/x/upgrade

go 1.23.0
go 1.23

require (
cosmossdk.io/api v0.7.5
Expand Down

0 comments on commit 0ad4295

Please sign in to comment.