Quellcode durchsuchen

Merge pull request #1211 from ming-relax/master

Makes code style consistent in kafka client after refresh metadata
Vlad Gorodetsky vor 6 Jahren
Ursprung
Commit
cbccf093cc
1 geänderte Dateien mit 2 neuen und 1 gelöschten Zeilen
  1. 2 1
      client.go

+ 2 - 1
client.go

@@ -288,7 +288,8 @@ func (client *client) Partitions(topic string) ([]int32, error) {
 		partitions = client.cachedPartitions(topic, allPartitions)
 	}
 
-	if partitions == nil {
+	// no partitions found after refresh metadata
+	if len(partitions) == 0 {
 		return nil, ErrUnknownTopicOrPartition
 	}