Bläddra i källkod

Minor lint changes

Partly cherry-picked from #575:
- remove an unnecessary `_`
- fix a few doc comments
- reorder an import
- elide nested slice literal types

The last one bears a bit of explanation: if you have a nested literal of a
complex type, you can ellide the inner literal types because they can be implied
from the outermost declaration. You've been able to do this for inner slices
since Go 1, but they only added the ability to do it for maps starting in Go 1.5
so we only do it for slices for now.
Evan Huus 10 år sedan
förälder
incheckning
03d03b3c61
4 ändrade filer med 8 tillägg och 9 borttagningar
  1. 2 2
      mocks/consumer.go
  2. 1 1
      mocks/mocks.go
  3. 2 1
      mocks/sync_producer.go
  4. 3 5
      snappy_test.go

+ 2 - 2
mocks/consumer.go

@@ -74,7 +74,7 @@ func (c *Consumer) Topics() ([]string, error) {
 	}
 
 	var result []string
-	for topic, _ := range c.metadata {
+	for topic := range c.metadata {
 		result = append(result, topic)
 	}
 	return result, nil
@@ -115,7 +115,7 @@ func (c *Consumer) Close() error {
 // Expectation API
 ///////////////////////////////////////////////////
 
-// SetMetadata sets the clusters topic/partition metadata,
+// SetTopicMetadata sets the clusters topic/partition metadata,
 // which will be returned by Topics() and Partitions().
 func (c *Consumer) SetTopicMetadata(metadata map[string][]int32) {
 	c.l.Lock()

+ 1 - 1
mocks/mocks.go

@@ -19,7 +19,7 @@ import (
 	"github.com/Shopify/sarama"
 )
 
-// A simple interface that includes the testing.T methods we use to report
+// ErrorReporter is a simple interface that includes the testing.T methods we use to report
 // expectation violations when using the mock objects.
 type ErrorReporter interface {
 	Errorf(string, ...interface{})

+ 2 - 1
mocks/sync_producer.go

@@ -1,8 +1,9 @@
 package mocks
 
 import (
-	"github.com/Shopify/sarama"
 	"sync"
+
+	"github.com/Shopify/sarama"
 )
 
 // SyncProducer implements sarama's SyncProducer interface for testing purposes.

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 3 - 5
snappy_test.go


Vissa filer visades inte eftersom för många filer har ändrats