Преглед на файлове

doc tweaks suggested by golint

Evan Huus преди 11 години
родител
ревизия
5cbd22983e
променени са 4 файла, в които са добавени 9 реда и са изтрити 10 реда
  1. 1 1
      broker.go
  2. 2 2
      client.go
  3. 2 2
      consumer.go
  4. 4 5
      producer.go

+ 1 - 1
broker.go

@@ -25,7 +25,7 @@ func NewBrokerConfig() *BrokerConfig {
 	}
 }
 
-// Validates a BrokerConfig instance. This will return a
+// Validate checks a BrokerConfig instance. This will return a
 // ConfigurationError if the specified values don't make sense.
 func (config *BrokerConfig) Validate() error {
 	if config.MaxOpenRequests < 0 {

+ 2 - 2
client.go

@@ -403,7 +403,7 @@ func (client *Client) update(data *MetadataResponse) ([]string, error) {
 	return ret, nil
 }
 
-// Creates a new ClientConfig instance with sensible defaults
+// NewClientConfig creates a new ClientConfig instance with sensible defaults
 func NewClientConfig() *ClientConfig {
 	return &ClientConfig{
 		MetadataRetries: 3,
@@ -411,7 +411,7 @@ func NewClientConfig() *ClientConfig {
 	}
 }
 
-// Validates a ClientConfig instance. This will return a
+// Validate checks a ClientConfig instance. This will return a
 // ConfigurationError if the specified values don't make sense.
 func (config *ClientConfig) Validate() error {
 	if config.MetadataRetries <= 0 {

+ 2 - 2
consumer.go

@@ -306,7 +306,7 @@ func (c *Consumer) getOffset(where OffsetTime, retry bool) (int64, error) {
 	return offset, nil
 }
 
-// Creates a ConsumerConfig instance with sane defaults.
+// NewConsumerConfig creates a ConsumerConfig instance with sane defaults.
 func NewConsumerConfig() *ConsumerConfig {
 	return &ConsumerConfig{
 		DefaultFetchSize: 32768,
@@ -316,7 +316,7 @@ func NewConsumerConfig() *ConsumerConfig {
 	}
 }
 
-// Validates a ConsumerConfig instance. It will return a
+// Validate checks a ConsumerConfig instance. It will return a
 // ConfigurationError if the specified value doesn't make sense.
 func (config *ConsumerConfig) Validate() error {
 	if config.DefaultFetchSize <= 0 {

+ 4 - 5
producer.go

@@ -83,9 +83,8 @@ func NewProducer(client *Client, config *ProducerConfig) (*Producer, error) {
 	}, nil
 }
 
-// When operating in asynchronous mode, provides access to errors generated
-// while parsing ProduceResponses from kafka. Should never be called in
-// synchronous mode.
+// Errors provides access to errors generated while parsing ProduceResponses from kafka
+// when operating in asynchronous mode. Should never be called in synchronous mode.
 func (p *Producer) Errors() chan error {
 	return p.errors
 }
@@ -452,7 +451,7 @@ func (p *Producer) choosePartition(topic string, key Encoder) (int32, error) {
 	return partitions[choice], nil
 }
 
-// Creates a new ProducerConfig instance with sensible defaults.
+// NewProducerConfig creates a new ProducerConfig instance with sensible defaults.
 func NewProducerConfig() *ProducerConfig {
 	return &ProducerConfig{
 		Partitioner:      NewRandomPartitioner(),
@@ -462,7 +461,7 @@ func NewProducerConfig() *ProducerConfig {
 	}
 }
 
-// Validates a ProducerConfig instance. It will return a
+// Validate checks a ProducerConfig instance. It will return a
 // ConfigurationError if the specified value doesn't make sense.
 func (config *ProducerConfig) Validate() error {
 	if config.RequiredAcks < -1 {