Preparing report...

Report for github.com/apache/pulsar-client-go

A+    Excellent!    Found 59 issues across 153 files

Tweet

gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


golint65%

Golint is a linter for Go source code.

    • pulsar-client-go/pulsar/internal/auth/athenz.go
    • Line 37: warning: exported const AthenzRoleAuthHeader should have comment (or a comment on this block) or be unexported (golint)
    • Line 63: warning: exported function NewAuthenticationAthenzWithParams should have comment or be unexported (golint)
    • Line 75: warning: exported function NewAuthenticationAthenz should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/internal/topic_name.go
    • Line 109: warning: exported function TopicNameWithoutPartitionPart should have comment or be unexported (golint)
    • Line 128: warning: exported function IsV2TopicName should have comment or be unexported (golint)
    • Line 135: warning: exported function GetTopicRestPath should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/internal/service_uri.go
    • Line 31: warning: exported const BinaryService should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported type PulsarServiceURI should have comment or be unexported (golint)
    • Line 49: warning: exported function NewPulsarServiceURIFromURIString should have comment or be unexported (golint)
    • Line 58: warning: exported function NewPulsarServiceURIFromURL should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/producer.go
    • Line 25: warning: exported type HashingScheme should have comment or be unexported (golint)
    • Line 34: warning: exported type CompressionType should have comment or be unexported (golint)
    • Line 37: warning: exported const NoCompression should have comment (or a comment on this block) or be unexported (golint)
    • Line 43: warning: exported type CompressionLevel should have comment or be unexported (golint)
    • Line 52: warning: comment on exported const Better should be of the form "Better ..." (golint)
    • Line 62: warning: exported type ProducerOptions should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/internal/commands.go
    • Line 49: warning: exported var ErrConnectionClosed should have comment or be unexported (golint)
    • Line 51: warning: exported function NewMessageReader should have comment or be unexported (golint)
    • Line 57: warning: exported function NewMessageReaderFromArray should have comment or be unexported (golint)
    • Line 92: warning: exported method MessageReader.ReadMessageMetadata should have comment or be unexported (golint)
    • Line 122: warning: exported method MessageReader.ReadMessage should have comment or be unexported (golint)
    • Line 153: warning: exported method MessageReader.ResetBuffer should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/primitiveSerDe.go
    • Line 28: warning: exported const IoMaxSize should have comment (or a comment on this block) or be unexported (golint)
    • Line 36: warning: exported type BinaryFreeList should have comment or be unexported (golint)
    • Line 38: warning: exported var BinarySerializer should have comment or be unexported (golint)
    • Line 40: warning: exported method BinaryFreeList.Borrow should have comment or be unexported (golint)
    • Line 50: warning: exported method BinaryFreeList.Return should have comment or be unexported (golint)
    • Line 57: warning: exported method BinaryFreeList.Uint8 should have comment or be unexported (golint)
    • Line 68: warning: exported method BinaryFreeList.Uint16 should have comment or be unexported (golint)
    • Line 79: warning: exported method BinaryFreeList.Uint32 should have comment or be unexported (golint)
    • Line 90: warning: exported method BinaryFreeList.Uint64 should have comment or be unexported (golint)
    • Line 101: warning: exported method BinaryFreeList.Float64 should have comment or be unexported (golint)
    • Line 108: warning: exported method BinaryFreeList.Float32 should have comment or be unexported (golint)
    • Line 115: warning: exported method BinaryFreeList.PutUint8 should have comment or be unexported (golint)
    • Line 123: warning: exported method BinaryFreeList.PutUint16 should have comment or be unexported (golint)
    • Line 131: warning: exported method BinaryFreeList.PutUint32 should have comment or be unexported (golint)
    • Line 140: warning: exported method BinaryFreeList.PutUint64 should have comment or be unexported (golint)
    • Line 148: warning: exported method BinaryFreeList.PutDouble should have comment or be unexported (golint)
    • Line 176: warning: exported method BinaryFreeList.PutFloat should have comment or be unexported (golint)
    • Line 204: warning: exported function ReadElements should have comment or be unexported (golint)
    • Line 214: warning: exported function WriteElements should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/producer_interceptor.go
    • Line 20: warning: exported type ProducerInterceptor should have comment or be unexported (golint)
    • Line 29: warning: exported type ProducerInterceptors should have comment or be unexported (golint)
    • Line 31: warning: exported method ProducerInterceptors.BeforeSend should have comment or be unexported (golint)
    • Line 37: warning: exported method ProducerInterceptors.OnSendAcknowledgement should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/internal/pulsartracing/consumer_interceptor.go
    • Line 29: warning: exported type ConsumerInterceptor should have comment or be unexported (golint)
    • Line 32: warning: exported method ConsumerInterceptor.BeforeConsume should have comment or be unexported (golint)
    • Line 36: warning: exported method ConsumerInterceptor.OnAcknowledge should have comment or be unexported (golint)
    • Line 38: warning: exported method ConsumerInterceptor.OnNegativeAcksSend should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/schema.go
    • Line 32: warning: exported type SchemaType should have comment or be unexported (golint)
    • Line 35: warning: exported const NONE should have comment (or a comment on this block) or be unexported (golint)
    • Line 57: warning: comment on exported type SchemaInfo should be of the form "SchemaInfo ..." (with optional leading article) (golint)
    • Line 65: warning: exported type Schema should have comment or be unexported (golint)
    • Line 72: warning: exported type AvroCodec should have comment or be unexported (golint)
    • Line 76: warning: exported function NewSchemaDefinition should have comment or be unexported (golint)
    • Line 89: warning: exported type JSONSchema should have comment or be unexported (golint)
    • Line 94: warning: exported function NewJSONSchema should have comment or be unexported (golint)
    • Line 108: warning: exported method JSONSchema.Encode should have comment or be unexported (golint)
    • Line 112: warning: exported method JSONSchema.Decode should have comment or be unexported (golint)
    • Line 116: warning: exported method JSONSchema.Validate should have comment or be unexported (golint)
    • Line 120: warning: exported method JSONSchema.GetSchemaInfo should have comment or be unexported (golint)
    • Line 124: warning: exported type ProtoSchema should have comment or be unexported (golint)
    • Line 129: warning: exported function NewProtoSchema should have comment or be unexported (golint)
    • Line 144: warning: exported method ProtoSchema.Encode should have comment or be unexported (golint)
    • Line 148: warning: exported method ProtoSchema.Decode should have comment or be unexported (golint)
    • Line 152: warning: exported method ProtoSchema.Validate should have comment or be unexported (golint)
    • Line 156: warning: exported method ProtoSchema.GetSchemaInfo should have comment or be unexported (golint)
    • Line 160: warning: exported type AvroSchema should have comment or be unexported (golint)
    • Line 165: warning: exported function NewAvroSchema should have comment or be unexported (golint)
    • Line 180: warning: exported method AvroSchema.Encode should have comment or be unexported (golint)
    • Line 194: warning: exported method AvroSchema.Decode should have comment or be unexported (golint)
    • Line 213: warning: exported method AvroSchema.Validate should have comment or be unexported (golint)
    • Line 217: warning: exported method AvroSchema.GetSchemaInfo should have comment or be unexported (golint)
    • Line 221: warning: exported type StringSchema should have comment or be unexported (golint)
    • Line 225: warning: exported function NewStringSchema should have comment or be unexported (golint)
    • Line 234: warning: exported method StringSchema.Encode should have comment or be unexported (golint)
    • Line 238: warning: exported method StringSchema.Decode should have comment or be unexported (golint)
    • Line 249: warning: exported method StringSchema.Validate should have comment or be unexported (golint)
    • Line 253: warning: exported method StringSchema.GetSchemaInfo should have comment or be unexported (golint)
    • Line 257: warning: exported type BytesSchema should have comment or be unexported (golint)
    • Line 261: warning: exported function NewBytesSchema should have comment or be unexported (golint)
    • Line 270: warning: exported method BytesSchema.Encode should have comment or be unexported (golint)
    • Line 274: warning: exported method BytesSchema.Decode should have comment or be unexported (golint)
    • Line 279: warning: exported method BytesSchema.Validate should have comment or be unexported (golint)
    • Line 283: warning: exported method BytesSchema.GetSchemaInfo should have comment or be unexported (golint)
    • Line 287: warning: exported type Int8Schema should have comment or be unexported (golint)
    • Line 291: warning: exported function NewInt8Schema should have comment or be unexported (golint)
    • Line 300: warning: exported method Int8Schema.Encode should have comment or be unexported (golint)
    • Line 306: warning: exported method Int8Schema.Decode should have comment or be unexported (golint)
    • Line 311: warning: exported method Int8Schema.Validate should have comment or be unexported (golint)
    • Line 318: warning: exported method Int8Schema.GetSchemaInfo should have comment or be unexported (golint)
    • Line 322: warning: exported type Int16Schema should have comment or be unexported (golint)
    • Line 326: warning: exported function NewInt16Schema should have comment or be unexported (golint)
    • Line 335: warning: exported method Int16Schema.Encode should have comment or be unexported (golint)
    • Line 341: warning: exported method Int16Schema.Decode should have comment or be unexported (golint)
    • Line 346: warning: exported method Int16Schema.Validate should have comment or be unexported (golint)
    • Line 353: warning: exported method Int16Schema.GetSchemaInfo should have comment or be unexported (golint)
    • Line 357: warning: exported type Int32Schema should have comment or be unexported (golint)
    • Line 361: warning: exported function NewInt32Schema should have comment or be unexported (golint)
    • Line 370: warning: exported method Int32Schema.Encode should have comment or be unexported (golint)
    • Line 376: warning: exported method Int32Schema.Decode should have comment or be unexported (golint)
    • Line 381: warning: exported method Int32Schema.Validate should have comment or be unexported (golint)
    • Line 388: warning: exported method Int32Schema.GetSchemaInfo should have comment or be unexported (golint)
    • Line 392: warning: exported type Int64Schema should have comment or be unexported (golint)
    • Line 396: warning: exported function NewInt64Schema should have comment or be unexported (golint)
    • Line 405: warning: exported method Int64Schema.Encode should have comment or be unexported (golint)
    • Line 411: warning: exported method Int64Schema.Decode should have comment or be unexported (golint)
    • Line 416: warning: exported method Int64Schema.Validate should have comment or be unexported (golint)
    • Line 423: warning: exported method Int64Schema.GetSchemaInfo should have comment or be unexported (golint)
    • Line 427: warning: exported type FloatSchema should have comment or be unexported (golint)
    • Line 431: warning: exported function NewFloatSchema should have comment or be unexported (golint)
    • Line 440: warning: exported method FloatSchema.Encode should have comment or be unexported (golint)
    • Line 444: warning: exported method FloatSchema.Decode should have comment or be unexported (golint)
    • Line 454: warning: exported method FloatSchema.Validate should have comment or be unexported (golint)
    • Line 461: warning: exported method FloatSchema.GetSchemaInfo should have comment or be unexported (golint)
    • Line 465: warning: exported type DoubleSchema should have comment or be unexported (golint)
    • Line 469: warning: exported function NewDoubleSchema should have comment or be unexported (golint)
    • Line 478: warning: exported method DoubleSchema.Encode should have comment or be unexported (golint)
    • Line 482: warning: exported method DoubleSchema.Decode should have comment or be unexported (golint)
    • Line 492: warning: exported method DoubleSchema.Validate should have comment or be unexported (golint)
    • Line 499: warning: exported method DoubleSchema.GetSchemaInfo should have comment or be unexported (golint)
    • pulsar-client-go/perf/pulsar-perf-go.go
    • Line 41: warning: exported var PrometheusPort should have comment or be unexported (golint)
    • Line 43: warning: exported type ClientArgs should have comment or be unexported (golint)
    • Line 51: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 130: warning: exported function RunProfiling should have comment or be unexported (golint)
    • pulsar-client-go/oauth2/auth.go
    • Line 30: warning: exported const ClaimNameUserName should have comment (or a comment on this block) or be unexported (golint)
    • Line 46: warning: exported type AuthorizationGrantType should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/internal/client_handlers.go
    • Line 22: warning: comment on exported type ClientHandlers should be of the form "ClientHandlers ..." (with optional leading article) (golint)
    • Line 28: warning: exported function NewClientHandlers should have comment or be unexported (golint)
    • Line 34: warning: exported method ClientHandlers.Add should have comment or be unexported (golint)
    • Line 40: warning: exported method ClientHandlers.Del should have comment or be unexported (golint)
    • Line 46: warning: exported method ClientHandlers.Val should have comment or be unexported (golint)
    • Line 52: warning: exported method ClientHandlers.Close should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/internal/lookup_service.go
    • Line 41: warning: exported const Persistent should have comment (or a comment on this block) or be unexported (golint)
    • Line 245: warning: exported const HTTPLookupServiceBasePathV1 should have comment or be unexported (golint)
    • Line 246: warning: exported const HTTPLookupServiceBasePathV2 should have comment or be unexported (golint)
    • Line 247: warning: exported const HTTPAdminServiceV1Format should have comment or be unexported (golint)
    • Line 248: warning: exported const HTTPAdminServiceV2Format should have comment or be unexported (golint)
    • Line 249: warning: exported const HTTPTopicUnderNamespaceV1 should have comment or be unexported (golint)
    • Line 250: warning: exported const HTTPTopicUnderNamespaceV2 should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/consumer_interceptor.go
    • Line 20: warning: exported type ConsumerInterceptor should have comment or be unexported (golint)
    • Line 31: warning: exported type ConsumerInterceptors should have comment or be unexported (golint)
    • Line 33: warning: exported method ConsumerInterceptors.BeforeConsume should have comment or be unexported (golint)
    • Line 39: warning: exported method ConsumerInterceptors.OnAcknowledge should have comment or be unexported (golint)
    • Line 45: warning: exported method ConsumerInterceptors.OnNegativeAcksSend should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/internal/pulsartracing/message_carrier_util.go
    • Line 28: warning: exported function InjectProducerMessageSpanContext should have comment or be unexported (golint)
    • Line 40: warning: exported function ExtractSpanContextFromProducerMessage should have comment or be unexported (golint)
    • Line 52: warning: exported function ExtractSpanContextFromConsumerMessage should have comment or be unexported (golint)
    • Line 64: warning: exported function InjectConsumerMessageSpanContext should have comment or be unexported (golint)
    • Line 80: warning: exported function CreateSpanFromMessage should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/internal/connection.go
    • Line 42: warning: comment on exported const PulsarVersion should be of the form "PulsarVersion ..." (golint)
    • Line 44: warning: exported const ClientVersionString should have comment (or a comment on this block) or be unexported (golint)
    • Line 49: warning: exported type TLSOptions should have comment or be unexported (golint)
    • Line 84: warning: exported type ConsumerHandler should have comment or be unexported (golint)
    • pulsar-client-go/oauth2/store/keyring.go
    • Line 31: warning: exported type KeyringStore should have comment or be unexported (golint)
    • Line 54: warning: exported method KeyringStore.SaveGrant should have comment or be unexported (golint)
    • Line 89: warning: exported method KeyringStore.LoadGrant should have comment or be unexported (golint)
    • Line 115: warning: exported method KeyringStore.WhoAmI should have comment or be unexported (golint)
    • Line 130: warning: exported method KeyringStore.Logout should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/internal/pulsartracing/message_carrier_adaptors.go
    • Line 31: warning: exported method ProducerMessageExtractAdapter.ForeachKey should have comment or be unexported (golint)
    • Line 41: warning: exported method ProducerMessageExtractAdapter.Set should have comment or be unexported (golint)
    • Line 48: warning: exported method ProducerMessageInjectAdapter.ForeachKey should have comment or be unexported (golint)
    • Line 52: warning: exported method ProducerMessageInjectAdapter.Set should have comment or be unexported (golint)
    • Line 61: warning: exported method ConsumerMessageExtractAdapter.ForeachKey should have comment or be unexported (golint)
    • Line 71: warning: exported method ConsumerMessageExtractAdapter.Set should have comment or be unexported (golint)
    • Line 78: warning: exported method ConsumerMessageInjectAdapter.ForeachKey should have comment or be unexported (golint)
    • Line 82: warning: exported method ConsumerMessageInjectAdapter.Set should have comment or be unexported (golint)
    • pulsar-client-go/oauth2/client_credentials_provider.go
    • Line 27: warning: exported const FILE should have comment (or a comment on this block) or be unexported (golint)
    • Line 31: warning: exported type KeyFileProvider should have comment or be unexported (golint)
    • Line 35: warning: exported type KeyFile should have comment or be unexported (golint)
    • Line 43: warning: exported function NewClientCredentialsProviderFromKeyFile should have comment or be unexported (golint)
    • Line 51: warning: exported method KeyFileProvider.GetClientCredentials should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/crypto/message_metadata.go
    • Line 39: warning: exported type MessageMetadata should have comment or be unexported (golint)
    • Line 43: warning: exported function NewMessageMetadataSupplier should have comment or be unexported (golint)
    • Line 49: warning: exported method MessageMetadata.EncryptionKeys should have comment or be unexported (golint)
    • Line 61: warning: exported method MessageMetadata.UpsertEncryptionkey should have comment or be unexported (golint)
    • Line 78: warning: exported method MessageMetadata.EncryptionParam should have comment or be unexported (golint)
    • Line 85: warning: exported method MessageMetadata.SetEncryptionParam should have comment or be unexported (golint)
    • pulsar-client-go/oauth2/device_code_flow.go
    • Line 42: warning: comment on exported type DeviceCodeProvider should be of the form "DeviceCodeProvider ..." (with optional leading article) (golint)
    • Line 53: warning: exported type DeviceCodeCallback should have comment or be unexported (golint)
    • Line 55: warning: exported type DeviceCodeFlowOptions should have comment or be unexported (golint)
    • Line 110: warning: exported method DeviceCodeFlow.Authorize should have comment or be unexported (golint)
    • Line 153: warning: exported type DeviceAuthorizationGrantRefresher should have comment or be unexported (golint)
    • Line 170: warning: exported method DeviceAuthorizationGrantRefresher.Refresh should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/internal/metrics.go
    • Line 26: warning: exported type Metrics should have comment or be unexported (golint)
    • Line 63: warning: exported type TopicMetrics should have comment or be unexported (golint)
    • Line 92: warning: exported function NewMetricsProvider should have comment or be unexported (golint)
    • Line 468: warning: exported method Metrics.GetTopicMetrics should have comment or be unexported (golint)
    • pulsar-client-go/oauth2/store/memory.go
    • Line 27: warning: exported type MemoryStore should have comment or be unexported (golint)
    • Line 33: warning: exported function NewMemoryStore should have comment or be unexported (golint)
    • Line 42: warning: exported method MemoryStore.SaveGrant should have comment or be unexported (golint)
    • Line 49: warning: exported method MemoryStore.LoadGrant should have comment or be unexported (golint)
    • Line 59: warning: exported method MemoryStore.WhoAmI should have comment or be unexported (golint)
    • Line 82: warning: exported method MemoryStore.Logout should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/crypto/encryption_key_Info.go
    • Line 20: warning: comment on exported type EncryptionKeyInfo should be of the form "EncryptionKeyInfo ..." (with optional leading article) (golint)
    • Line 27: warning: comment on exported function NewEncryptionKeyInfo should be of the form "NewEncryptionKeyInfo ..." (golint)
    • Line 36: warning: comment on exported method EncryptionKeyInfo.Name should be of the form "Name ..." (golint)
    • Line 41: warning: comment on exported method EncryptionKeyInfo.Key should be of the form "Key ..." (golint)
    • Line 46: warning: comment on exported method EncryptionKeyInfo.Metadata should be of the form "Metadata ..." (golint)
    • pulsar-client-go/pulsar/consumer.go
    • Line 25: warning: comment on exported type ConsumerMessage should be of the form "ConsumerMessage ..." (with optional leading article) (golint)
    • Line 53: warning: exported type SubscriptionInitialPosition should have comment or be unexported (golint)
    • Line 56: warning: comment on exported const SubscriptionPositionLatest should be of the form "SubscriptionPositionLatest ..." (golint)
    • Line 59: warning: comment on exported const SubscriptionPositionEarliest should be of the form "SubscriptionPositionEarliest ..." (golint)
    • Line 63: warning: comment on exported type DLQPolicy should be of the form "DLQPolicy ..." (with optional leading article) (golint)
    • pulsar-client-go/oauth2/client_credentials_flow.go
    • Line 48: warning: exported type ClientCredentialsFlowOptions should have comment or be unexported (golint)
    • Line 95: warning: exported method ClientCredentialsFlow.Authorize should have comment or be unexported (golint)
    • Line 117: warning: exported type ClientCredentialsGrantRefresher should have comment or be unexported (golint)
    • Line 122: warning: exported function NewDefaultClientCredentialsGrantRefresher should have comment or be unexported (golint)
    • Line 132: warning: exported method ClientCredentialsGrantRefresher.Refresh should have comment or be unexported (golint)
    • pulsar-client-go/pulsar/batcher_builder.go
    • Line 24: warning: exported type BatcherBuilderType should have comment or be unexported (golint)
    • Line 27: warning: exported const DefaultBatchBuilder should have comment (or a comment on this block) or be unexported (golint)
    • Line 31: warning: exported function GetBatcherBuilderProvider should have comment or be unexported (golint)
    • pulsar-client-go/oauth2/device_code_provider.go
    • Line 29: warning: comment on exported type LocalDeviceCodeProvider should be of the form "LocalDeviceCodeProvider ..." (with optional leading article) (golint)
    • Line 37: warning: exported type DeviceCodeRequest should have comment or be unexported (golint)
    • Line 53: warning: exported type LocalDeviceCodeProviderOptions should have comment or be unexported (golint)

gocyclo94%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

    • pulsar-client-go/pulsar/producer_partition.go
    • Line 402: warning: cyclomatic complexity 21 of function (*partitionProducer).internalSend() is high (> 15) (gocyclo)
    • Line 180: warning: cyclomatic complexity 17 of function (*partitionProducer).grabCnx() is high (> 15) (gocyclo)
    • Line 542: warning: cyclomatic complexity 16 of function (*partitionProducer).failTimeoutMessages() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!