Skip to content

Commit

Permalink
fix(lint): golang-client lint errors (#3924)
Browse files Browse the repository at this point in the history
<!--
Please read and fill out this form before submitting your PR.

Please make sure you have reviewed our contributors guide before
submitting your
first PR.
-->
Closes #3919
## Overview

<!-- 
Please provide an explanation of the PR, including the appropriate
context,
background, goal, and rationale. If there is an issue with this
information,
please provide a tl;dr and link the issue. 
-->
Fix the lint errors of golangci-lint.
Merge this [PR](#3923)
to this branch.
  • Loading branch information
kobakaku authored Sep 30, 2024
1 parent 21e78b9 commit 363a8c5
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ run:

linters:
enable:
- exportloopref
- copyloopvar
- gofumpt
- misspell
- nakedret
Expand Down
1 change: 0 additions & 1 deletion app/test/priority_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ func (s *PriorityTestSuite) TestPriorityByGasPrice() {
wg := &sync.WaitGroup{}
for _, accName := range s.accountNames {
wg.Add(1)
accName := accName // new variable per iteration
go func() {
defer wg.Done()
// ensure that it is greater than the min gas price
Expand Down
3 changes: 0 additions & 3 deletions pkg/da/data_availability_header_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ func TestExtendShares(t *testing.T) {
}

for _, tt := range tests {
tt := tt
_, err := ExtendShares(tt.shares)
if tt.expectedErr {
require.NotNil(t, err)
Expand Down Expand Up @@ -122,7 +121,6 @@ func TestDataAvailabilityHeaderProtoConversion(t *testing.T) {
}

for _, tt := range tests {
tt := tt
pdah, err := tt.dah.ToProto()
require.NoError(t, err)
resDah, err := DataAvailabilityHeaderFromProto(pdah)
Expand Down Expand Up @@ -203,7 +201,6 @@ func Test_DAHValidateBasic(t *testing.T) {
}

for _, tt := range tests {
tt := tt
err := tt.dah.ValidateBasic()
if tt.expectErr {
require.True(t, strings.Contains(err.Error(), tt.errStr), tt.name)
Expand Down
1 change: 0 additions & 1 deletion x/blob/client/testutil/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ func (s *IntegrationTestSuite) TestSubmitPayForBlob() {
}

for _, tc := range testCases {
tc := tc
require.NoError(s.ctx.WaitForNextBlock())
s.Run(tc.name, func() {
cmd := paycli.CmdPayForBlob()
Expand Down
4 changes: 2 additions & 2 deletions x/blobstream/keeper/keeper_data_commitment.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (k Keeper) GetLatestDataCommitment(ctx sdk.Context) (types.DataCommitment,
return types.DataCommitment{}, err
}
if !found {
return types.DataCommitment{}, errors.Wrapf(types.ErrAttestationNotFound, fmt.Sprintf("nonce %d", i))
return types.DataCommitment{}, errors.Wrapf(types.ErrAttestationNotFound, "nonce %d", i)
}
dcc, ok := att.(*types.DataCommitment)
if !ok {
Expand All @@ -136,7 +136,7 @@ func (k Keeper) HasDataCommitmentInStore(ctx sdk.Context) (bool, error) {
return false, err
}
if !found {
return false, errors.Wrapf(types.ErrAttestationNotFound, fmt.Sprintf("nonce %d", i))
return false, errors.Wrapf(types.ErrAttestationNotFound, "nonce %d", i)
}
_, ok := att.(*types.DataCommitment)
if !ok {
Expand Down
1 change: 0 additions & 1 deletion x/blobstream/keeper/keeper_valset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func TestCurrentValsetNormalization(t *testing.T) {
},
}
for msg, spec := range specs {
spec := spec
t.Run(msg, func(t *testing.T) {
input, ctx := testutil.SetupTestChain(t, spec.srcPowers)
r, err := input.BlobstreamKeeper.GetCurrentValset(ctx)
Expand Down
6 changes: 0 additions & 6 deletions x/mint/client/testutil/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryInflationRate() {
}

for _, tc := range testCases {
tc := tc

s.Run(tc.name, func() {
cmd := cli.GetCmdQueryInflationRate()

Expand Down Expand Up @@ -103,8 +101,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryAnnualProvisions() {

expectedAnnualProvision := mint.InitialInflationRateAsDec().MulInt(sdk.NewInt(testnode.DefaultInitialBalance))
for _, tc := range testCases {
tc := tc

s.Run(tc.name, func() {
cmd := cli.GetCmdQueryAnnualProvisions()
out, err := clitestutil.ExecTestCLICmd(s.cctx.Context, cmd, tc.args)
Expand Down Expand Up @@ -134,8 +130,6 @@ func (s *IntegrationTestSuite) TestGetCmdQueryGenesisTime() {
}

for _, tc := range testCases {
tc := tc

s.Run(tc.name, func() {
cmd := cli.GetCmdQueryGenesisTime()
out, err := clitestutil.ExecTestCLICmd(s.cctx.Context, cmd, tc.args)
Expand Down
1 change: 0 additions & 1 deletion x/mint/simulation/decoder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func TestDecodeStore(t *testing.T) {
}

for i, tt := range tests {
i, tt := i, tt
t.Run(tt.name, func(t *testing.T) {
if tt.expectPanic {
require.Panics(t, func() { decoder(kvPairs.Pairs[i], kvPairs.Pairs[i]) }, tt.name)
Expand Down

0 comments on commit 363a8c5

Please sign in to comment.