chore: bump golangci-lint and fix all linting issues (#21761)
This commit is contained in:
@@ -72,7 +72,6 @@ func TestPromptParseInteger(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range values {
|
||||
tc := tc
|
||||
t.Run(tc.in, func(t *testing.T) {
|
||||
origStdin := readline.Stdin
|
||||
defer func() {
|
||||
|
||||
@@ -160,8 +160,6 @@ func (s *CLITestSuite) TestNewCmdSubmitProposal() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
s.Run(tc.name, func() {
|
||||
cmd := cli.NewCmdSubmitProposal()
|
||||
|
||||
@@ -256,8 +254,6 @@ func (s *CLITestSuite) TestNewCmdSubmitLegacyProposal() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
s.Run(tc.name, func() {
|
||||
cmd := cli.NewCmdSubmitLegacyProposal()
|
||||
|
||||
@@ -360,7 +356,6 @@ func (s *CLITestSuite) TestNewCmdWeightedVote() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
s.Run(tc.name, func() {
|
||||
cmd := cli.NewCmdWeightedVote()
|
||||
out, err := clitestutil.ExecTestCLICmd(s.clientCtx, cmd, tc.args)
|
||||
|
||||
@@ -193,8 +193,6 @@ func TestGetPaginatedVotes(t *testing.T) {
|
||||
},
|
||||
},
|
||||
} {
|
||||
tc := tc
|
||||
|
||||
t.Run(tc.description, func(t *testing.T) {
|
||||
marshaled := make([][]byte, len(tc.msgs))
|
||||
clientCtx := client.Context{}.
|
||||
@@ -298,8 +296,6 @@ func TestGetSingleVote(t *testing.T) {
|
||||
},
|
||||
},
|
||||
} {
|
||||
tc := tc
|
||||
|
||||
t.Run(tc.description, func(t *testing.T) {
|
||||
marshaled := make([][]byte, len(tc.msgs))
|
||||
clientCtx := client.Context{}.
|
||||
|
||||
@@ -938,8 +938,6 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
suite.Run(fmt.Sprintf("Case %s", tc.msg), func() {
|
||||
params, err := queryClient.Params(gocontext.Background(), &tc.req)
|
||||
|
||||
@@ -1008,7 +1006,6 @@ func (suite *KeeperTestSuite) TestGRPCQueryMessagedBasedParams() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
suite.Run(fmt.Sprintf("Case %s", tc.msg), func() {
|
||||
params, err := queryClient.MessageBasedParams(suite.ctx, &tc.req)
|
||||
if tc.expErrMsg != "" {
|
||||
|
||||
@@ -2008,7 +2008,6 @@ func (suite *KeeperTestSuite) TestMsgUpdateParams() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
suite.Run(tc.name, func() {
|
||||
msg := tc.input()
|
||||
exec := func(updateParams *v1.MsgUpdateParams) error {
|
||||
@@ -2154,7 +2153,6 @@ func (suite *KeeperTestSuite) TestMsgUpdateMessageParams() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
suite.Run(tc.name, func() {
|
||||
_, err := suite.msgSrvr.UpdateMessageParams(suite.ctx, tc.input)
|
||||
if tc.expErrMsg != "" {
|
||||
@@ -2308,7 +2306,6 @@ func (suite *KeeperTestSuite) TestMsgSudoExec() {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
suite.Run(tc.name, func() {
|
||||
_, err := suite.msgSrvr.SudoExec(suite.ctx, tc.input)
|
||||
if tc.expErrMsg != "" {
|
||||
|
||||
@@ -49,7 +49,6 @@ func TestConvertToLegacyProposal(t *testing.T) {
|
||||
|
||||
for name, tc := range testCases {
|
||||
t.Run(name, func(t *testing.T) {
|
||||
tc := tc
|
||||
proposal.FinalTallyResult = &tc.tallyResult
|
||||
v1beta1Proposal, err := v3.ConvertToLegacyProposal(proposal)
|
||||
if tc.expErr {
|
||||
@@ -156,8 +155,6 @@ func TestConvertToLegacyTallyResult(t *testing.T) {
|
||||
},
|
||||
}
|
||||
for name, tc := range testCases {
|
||||
tc := tc
|
||||
|
||||
t.Run(name, func(t *testing.T) {
|
||||
_, err := v3.ConvertToLegacyTallyResult(&tc.tallyResult)
|
||||
if tc.expErr {
|
||||
|
||||
@@ -100,8 +100,6 @@ func TestRandomizedGenState1(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tt := range tests {
|
||||
tt := tt
|
||||
|
||||
require.Panicsf(t, func() { simulation.RandomizedGenState(&tt.simState) }, tt.panicMsg)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,7 +175,6 @@ func TestValidateGenesis(t *testing.T) {
|
||||
}
|
||||
|
||||
for _, tc := range testCases {
|
||||
tc := tc
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
err := v1.ValidateGenesis(codec, tc.genesisState())
|
||||
if tc.expErrMsg != "" {
|
||||
|
||||
Reference in New Issue
Block a user