Skip to content

Commit ac2babf

Browse files
committed
all: fix default linters
1 parent fe458d7 commit ac2babf

File tree

20 files changed

+44
-152
lines changed

20 files changed

+44
-152
lines changed

.golangci-lint.yaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
1-
run:
2-
3-
linters:
4-
disable-all: true
5-
enable:
6-
- errcheck
7-
- ineffassign
8-
- govet
9-
- gosimple
10-
- staticcheck
11-
121
issues:
132
exclude-rules:
143
- path: '(.+)_test\.go'
154
text: ".*GetPaymentHistory is deprecated: Payment history has migrated to chats"
165
- path: '(.+)testutil\.go'
17-
text: ".*GetPaymentHistory is deprecated: Payment history has migrated to chats"
6+
text: ".*GetPaymentHistory is deprecated: Payment history has migrated to chats"

pkg/code/async/account/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package async_account
33
// todo: setup configs
44

55
const (
6-
envConfigPrefix = "ACCOUNT_SERVICE_"
6+
envConfigPrefix = "ACCOUNT_SERVICE_" //nolint:unused
77
)
88

99
type conf struct {

pkg/code/async/geyser/handler_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ func TestTimelockV1ProgramAccountHandler(t *testing.T) {
1616

1717
}
1818

19-
type testEnv struct {
19+
type testEnv struct { //nolint:unused
2020
data code_data.Provider
2121
handlers map[string]ProgramAccountUpdateHandler
2222
}
2323

24-
func setup(t *testing.T) *testEnv {
24+
func setup(t *testing.T) *testEnv { //nolint:unused
2525
data := code_data.NewTestDataProvider()
2626
return &testEnv{
2727
data: data,

pkg/code/async/geyser/retry.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,12 @@ package async_geyser
22

33
import (
44
"context"
5-
"errors"
65
"time"
76

87
"github.com/code-payments/code-server/pkg/retry"
98
"github.com/code-payments/code-server/pkg/retry/backoff"
109
)
1110

12-
var (
13-
errSignatureNotConfirmed = errors.New("signature is not confirmed")
14-
errSignatureNotFinalized = errors.New("signature is not finalized")
15-
)
16-
1711
var waitForFinalizationRetryStrategies = []retry.Strategy{
1812
retry.NonRetriableErrors(context.Canceled),
1913
retry.Limit(30),

pkg/code/data/account/memory/store.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ func (s *store) CountRequiringAutoReturnCheck(ctx context.Context) (uint64, erro
404404
return uint64(len(items)), nil
405405
}
406406

407-
func cloneRecords(items []*account.Record) []*account.Record {
407+
func cloneRecords(items []*account.Record) []*account.Record { //nolint:unused
408408
res := make([]*account.Record, len(items))
409409

410410
for i, item := range items {

pkg/code/data/action/memory/store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"sync"
88
"time"
99

10+
"github.com/code-payments/code-server/pkg/code/data/action"
1011
"github.com/code-payments/code-server/pkg/database/query"
1112
"github.com/code-payments/code-server/pkg/pointer"
12-
"github.com/code-payments/code-server/pkg/code/data/action"
1313
)
1414

1515
type ById []*action.Record
@@ -90,7 +90,7 @@ func (s *store) findBySource(source string) []*action.Record {
9090
return res
9191
}
9292

93-
func (s *store) filter(items []*action.Record, cursor query.Cursor, limit uint64, direction query.Ordering) []*action.Record {
93+
func (s *store) filter(items []*action.Record, cursor query.Cursor, limit uint64, direction query.Ordering) []*action.Record { //nolint:unused
9494
var start uint64
9595

9696
start = 0

pkg/code/data/chat/memory/store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"sync"
88
"time"
99

10-
"github.com/code-payments/code-server/pkg/database/query"
1110
"github.com/code-payments/code-server/pkg/code/data/chat"
11+
"github.com/code-payments/code-server/pkg/database/query"
1212
)
1313

1414
type ChatsById []*chat.Chat
@@ -413,7 +413,7 @@ func (s *store) filterPagedMessagesByChat(items []*chat.Message, cursor query.Cu
413413
return res, nil
414414
}
415415

416-
func (s *store) sumContentLengths(items []*chat.Message) uint32 {
416+
func (s *store) sumContentLengths(items []*chat.Message) uint32 { //nolint:unused
417417
var res uint32
418418
for _, item := range items {
419419
res += uint32(item.ContentLength)

pkg/code/data/currency/memory/store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"sync"
77
"time"
88

9-
"github.com/code-payments/code-server/pkg/database/query"
109
"github.com/code-payments/code-server/pkg/code/data/currency"
10+
"github.com/code-payments/code-server/pkg/database/query"
1111
)
1212

1313
const (
@@ -36,7 +36,7 @@ func New() currency.Store {
3636
}
3737
}
3838

39-
func (s *store) reset() {
39+
func (s *store) reset() { //nolint:unused
4040
s.currencyStoreMu.Lock()
4141
s.currencyStore = make([]*currency.ExchangeRateRecord, 0)
4242
s.currencyStoreMu.Unlock()

pkg/code/data/fulfillment/memory/store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"sync"
88
"time"
99

10+
"github.com/code-payments/code-server/pkg/code/data/fulfillment"
1011
"github.com/code-payments/code-server/pkg/database/query"
1112
"github.com/code-payments/code-server/pkg/pointer"
12-
"github.com/code-payments/code-server/pkg/code/data/fulfillment"
1313
)
1414

1515
type store struct {
@@ -120,7 +120,7 @@ func (s *store) findByStateAndAddress(state fulfillment.State, address string) [
120120
return res
121121
}
122122

123-
func (s *store) findByStateAndAddressAsSource(state fulfillment.State, address string) []*fulfillment.Record {
123+
func (s *store) findByStateAndAddressAsSource(state fulfillment.State, address string) []*fulfillment.Record { //nolint:unused
124124
res := make([]*fulfillment.Record, 0)
125125
for _, item := range s.records {
126126
if item.State != state {

pkg/code/data/intent/memory/store.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"sync"
77
"time"
88

9-
"github.com/code-payments/code-server/pkg/database/query"
109
"github.com/code-payments/code-server/pkg/code/data/intent"
10+
"github.com/code-payments/code-server/pkg/database/query"
1111
)
1212

1313
type store struct {
@@ -63,7 +63,7 @@ func (s *store) findIntent(intentID string) *intent.Record {
6363
return nil
6464
}
6565

66-
func (s *store) findByState(state intent.State) []*intent.Record {
66+
func (s *store) findByState(state intent.State) []*intent.Record { //nolint:unused
6767
res := make([]*intent.Record, 0)
6868
for _, item := range s.records {
6969
if item.State == state {

0 commit comments

Comments
 (0)