Skip to content

Commit

Permalink
Merge pull request #1010 from size12/testifylint
Browse files Browse the repository at this point in the history
enabled wastedassign
  • Loading branch information
asmyasnikov authored Jan 24, 2024
2 parents 96e641b + a9ce335 commit 693fdbb
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 11 deletions.
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ linters:
- testpackage
- thelper
- varnamelen
- wastedassign
- wrapcheck
- wsl

Expand Down
9 changes: 4 additions & 5 deletions internal/background/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@ func TestWorkerConcurrentStartAndClose(t *testing.T) {
ctx := xtest.Context(t)
w := NewWorker(ctx)

closeIndex := int64(0)

stopNewStarts := xatomic.Bool{}
var wgStarters sync.WaitGroup
for i := 0; i < parallel; i++ {
Expand All @@ -134,11 +132,12 @@ func TestWorkerConcurrentStartAndClose(t *testing.T) {

require.NoError(t, w.Close(xtest.ContextWithCommonTimeout(ctx, t), nil))

closeIndex = counter.Load()
require.Equal(t, closeIndex, counter.Load())

stopNewStarts.Store(true)
xtest.WaitGroup(t, &wgStarters)

_, ok := <-w.tasks
require.False(t, ok)
require.True(t, w.closed)
})
}

Expand Down
2 changes: 1 addition & 1 deletion internal/table/scanner/perfomance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func BenchmarkTestSliceIncrement(b *testing.B) {
for j := 0; j < testSize; j++ {
slice[j] = &column{}
}
cnt := 0
var cnt int
var row column
b.ResetTimer()
for i := 0; i < b.N; i++ {
Expand Down
2 changes: 0 additions & 2 deletions internal/topic/retriable_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ func CheckRetryMode(err error, settings RetrySettings, retriesDuration time.Dura
return nil, false
}

isRetriable = true

mode := retry.Check(err)

decision := PublicRetryDecisionDefault
Expand Down
2 changes: 1 addition & 1 deletion internal/topic/topicwriterinternal/writer_reconnector.go
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ func (w *WriterReconnector) connectionLoop(ctx context.Context) {
return xcontext.WithCancel(xcontext.WithoutDeadline(ctx))
}

//nolint:ineffassign,staticcheck
//nolint:ineffassign,staticcheck,wastedassign
streamCtx, streamCtxCancel := createStreamContext()

defer streamCtxCancel()
Expand Down
3 changes: 2 additions & 1 deletion table/options/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ func (rr ReadReplicasSettings) ToYDB() *Ydb_Table.ReadReplicasSettings {
}

func NewReadReplicasSettings(rr *Ydb_Table.ReadReplicasSettings) ReadReplicasSettings {
t, c := ReadReplicasPerAzReadReplicas, uint64(0)
t := ReadReplicasPerAzReadReplicas
var c uint64

if c = rr.GetPerAzReadReplicasCount(); c != 0 {
t = ReadReplicasPerAzReadReplicas
Expand Down

0 comments on commit 693fdbb

Please sign in to comment.