diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8dc85561e..603c07696 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,7 +7,7 @@ on: pull_request: workflow_dispatch: env: - GOLANGCI_LINT_VERSION: v2.1.6 + GOLANGCI_LINT_VERSION: v2.4.0 GO_VERSION: '1.25' jobs: golangci: diff --git a/.golangci.yml b/.golangci.yml index 8c7460491..e096e31f6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -45,6 +45,10 @@ linters: - iface - gosmopolitan - funcorder + + # introduced v2.4.0 + - noinlineerr + - wsl_v5 settings: errcheck: check-type-assertions: false @@ -117,6 +121,10 @@ linters: - name: if-return - name: increment-decrement - name: var-naming + arguments: + - [] # AllowList + - [] # DenyList + - - skip-package-name-checks: true - name: var-declaration - name: package-comments - name: range diff --git a/examples/topic/topicreader/topicreader_handler.go b/examples/topic/topicreader/topicreader_handler.go index 58080cd1c..6686a1ccf 100644 --- a/examples/topic/topicreader/topicreader_handler.go +++ b/examples/topic/topicreader/topicreader_handler.go @@ -28,6 +28,7 @@ func StartReader(ctx context.Context, db *ydb.Driver) (*topiclistener.TopicListe type TopicEventsHandler struct { topiclistener.BaseHandler + listener *topiclistener.TopicListener m sync.Mutex diff --git a/internal/pool/pool_test.go b/internal/pool/pool_test.go index ff9e48bed..04bac6a5a 100644 --- a/internal/pool/pool_test.go +++ b/internal/pool/pool_test.go @@ -41,6 +41,7 @@ type ( } testWaitChPool struct { xsync.Pool[chan *testItem] + testHookGetWaitCh func() } ) diff --git a/internal/query/client.go b/internal/query/client.go index 40a50e243..f8efde56b 100644 --- a/internal/query/client.go +++ b/internal/query/client.go @@ -128,6 +128,7 @@ func (c *Client) FetchScriptResults(ctx context.Context, type executeScriptSettings struct { executeSettings + ttl time.Duration operationParams *Ydb_Operations.OperationParams } diff --git a/internal/query/options/retry.go b/internal/query/options/retry.go index 1ce69ff08..4c9dfaf41 100644 --- a/internal/query/options/retry.go +++ b/internal/query/options/retry.go @@ -33,6 +33,7 @@ type ( doTxSettings struct { doSettings + txSettings tx.Settings } diff --git a/internal/query/result_set.go b/internal/query/result_set.go index 43e4abe8e..b73903f77 100644 --- a/internal/query/result_set.go +++ b/internal/query/result_set.go @@ -40,6 +40,7 @@ type ( } resultSetWithClose struct { *resultSet + close func(ctx context.Context) error } ) diff --git a/internal/topic/configs.go b/internal/topic/configs.go index 00747e556..27eb02b0d 100644 --- a/internal/topic/configs.go +++ b/internal/topic/configs.go @@ -9,6 +9,7 @@ import ( type Config struct { config.Common + Trace *trace.Topic MaxGrpcMessageSize int } diff --git a/internal/topic/topiclistenerinternal/partition_worker_test.go b/internal/topic/topiclistenerinternal/partition_worker_test.go index bb0f71ccd..3e1aa55b4 100644 --- a/internal/topic/topiclistenerinternal/partition_worker_test.go +++ b/internal/topic/topiclistenerinternal/partition_worker_test.go @@ -28,6 +28,7 @@ import ( // syncMessageSender extends mockMessageSender with synchronization capabilities type syncMessageSender struct { *mockMessageSender + messageReceived empty.Chan } diff --git a/internal/topic/topicmock/grpc_topic_mock.go b/internal/topic/topicmock/grpc_topic_mock.go index 2be63c8e3..70b4b830c 100644 --- a/internal/topic/topicmock/grpc_topic_mock.go +++ b/internal/topic/topicmock/grpc_topic_mock.go @@ -89,6 +89,7 @@ func newGrpcMock(listener net.Listener, topicServiceImpl Ydb_Topic_V1.TopicServi type mockDiscoveryService struct { Ydb_Discovery_V1.UnimplementedDiscoveryServiceServer + host string port uint32 } diff --git a/internal/topic/topicreaderinternal/reader.go b/internal/topic/topicreaderinternal/reader.go index 258b29a32..da780ec44 100644 --- a/internal/topic/topicreaderinternal/reader.go +++ b/internal/topic/topicreaderinternal/reader.go @@ -248,10 +248,10 @@ func (r *Reader) CommitRanges(ctx context.Context, ranges []topicreadercommon.Pu type ReaderConfig struct { config.Common + topicStreamReaderConfig RetrySettings topic.RetrySettings DefaultBatchConfig ReadMessageBatchOptions - topicStreamReaderConfig } type PublicReaderOption func(cfg *ReaderConfig) diff --git a/internal/topic/topicreaderinternal/transaction_mock_test.go b/internal/topic/topicreaderinternal/transaction_mock_test.go index 04d56a65c..a4bbe5e3a 100644 --- a/internal/topic/topicreaderinternal/transaction_mock_test.go +++ b/internal/topic/topicreaderinternal/transaction_mock_test.go @@ -18,6 +18,7 @@ func newMockTransactionWrapper(sessionID, transactinID string) *mockTransaction type mockTransaction struct { tx.Identifier + materializedID tx.Identifier materialized bool sessionID string diff --git a/internal/xerrors/stacktrace.go b/internal/xerrors/stacktrace.go index a8ad83bf1..1ae8319e4 100644 --- a/internal/xerrors/stacktrace.go +++ b/internal/xerrors/stacktrace.go @@ -62,6 +62,7 @@ func (e *stackError) Unwrap() error { type stackTransportError struct { stackError + status *grpcStatus.Status } diff --git a/internal/xresolver/xresolver.go b/internal/xresolver/xresolver.go index 875d845d0..cd2850295 100644 --- a/internal/xresolver/xresolver.go +++ b/internal/xresolver/xresolver.go @@ -12,12 +12,14 @@ import ( type dnsBuilder struct { resolver.Builder + scheme string trace *trace.Driver } type clientConn struct { resolver.ClientConn + target resolver.Target trace *trace.Driver } diff --git a/operation/client.go b/operation/client.go index 21377a06c..a6568b21b 100644 --- a/operation/client.go +++ b/operation/client.go @@ -26,6 +26,7 @@ type ( // Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental listOperationsWithNextToken[PT metadata.Constraint[T], T metadata.TypesConstraint] struct { listOperations[PT, T] + NextToken string } // Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental @@ -41,6 +42,7 @@ type ( // Experimental: https://github.com/ydb-platform/ydb-go-sdk/blob/master/VERSIONING.md#experimental typedOperation[PT metadata.Constraint[T], T metadata.TypesConstraint] struct { operation + Metadata *T } ) diff --git a/pkg/xtest/grpclogger.go b/pkg/xtest/grpclogger.go index 102eeb5d2..23ee49c9b 100644 --- a/pkg/xtest/grpclogger.go +++ b/pkg/xtest/grpclogger.go @@ -68,6 +68,7 @@ func (l GrpcLogger) StreamClientInterceptor( type grpcLoggerStream struct { grpc.ClientStream + streamID int64 t testing.TB } diff --git a/pkg/xtest/logger.go b/pkg/xtest/logger.go index a712cfb75..48355a61c 100644 --- a/pkg/xtest/logger.go +++ b/pkg/xtest/logger.go @@ -12,8 +12,9 @@ func MakeSyncedTest(t *testing.T) *SyncedTest { } type SyncedTest struct { - m sync.Mutex *testing.T + + m sync.Mutex } func (s *SyncedTest) Cleanup(f func()) { diff --git a/scheme/scheme.go b/scheme/scheme.go index 1aeac9777..da1bfabef 100644 --- a/scheme/scheme.go +++ b/scheme/scheme.go @@ -20,6 +20,7 @@ type EntryType uint type Directory struct { Entry + Children []Entry } diff --git a/topic/topicsugar/iterators.go b/topic/topicsugar/iterators.go index e3ff2388e..6878ba453 100644 --- a/topic/topicsugar/iterators.go +++ b/topic/topicsugar/iterators.go @@ -136,6 +136,7 @@ func IteratorFunc[T any]( type TypedTopicMessage[T any] struct { *topicreader.Message + Data T }