This is an automated email from the ASF dual-hosted git repository.

sijie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new a1826af  use iota for go-client (#3474)
a1826af is described below

commit a1826afd7afcce35809751cffaf7378323f6727a
Author: 冉小龙 <[email protected]>
AuthorDate: Wed Jan 30 16:57:19 2019 +0800

    use iota for go-client (#3474)
    
    ### Motivation
    
    use iota to replace the original way
    
    Signed-off-by: xiaolong.ran <[email protected]>
---
 pulsar-client-go/pulsar/consumer.go |  6 +++---
 pulsar-client-go/pulsar/producer.go | 20 ++++++++++----------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/pulsar-client-go/pulsar/consumer.go 
b/pulsar-client-go/pulsar/consumer.go
index 030ba1b..6c4ae42 100644
--- a/pulsar-client-go/pulsar/consumer.go
+++ b/pulsar-client-go/pulsar/consumer.go
@@ -35,15 +35,15 @@ type SubscriptionType int
 
 const (
        // There can be only 1 consumer on the same topic with the same 
subscription name
-       Exclusive SubscriptionType = 0
+       Exclusive SubscriptionType = iota
 
        // Multiple consumer will be able to use the same subscription name and 
the messages will be dispatched according to
        // a round-robin rotation between the connected consumers
-       Shared SubscriptionType = 1
+       Shared
 
        // Multiple consumer will be able to use the same subscription name but 
only 1 consumer will receive the messages.
        // If that consumer disconnects, one of the other connected consumers 
will start receiving messages.
-       Failover SubscriptionType = 2
+       Failover
 )
 
 // ConsumerBuilder is used to configure and create instances of Consumer
diff --git a/pulsar-client-go/pulsar/producer.go 
b/pulsar-client-go/pulsar/producer.go
index a8f8778..17aea45 100644
--- a/pulsar-client-go/pulsar/producer.go
+++ b/pulsar-client-go/pulsar/producer.go
@@ -28,30 +28,30 @@ type MessageRoutingMode int
 
 const (
        // Publish messages across all partitions in round-robin.
-       RoundRobinDistribution MessageRoutingMode = 0
+       RoundRobinDistribution MessageRoutingMode = iota
 
        // The producer will chose one single partition and publish all the 
messages into that partition
-       UseSinglePartition MessageRoutingMode = 1
+       UseSinglePartition
 
        // Use custom message router implementation that will be called to 
determine the partition for a particular message.
-       CustomPartition MessageRoutingMode = 2
+       CustomPartition
 )
 
 type HashingScheme int
 
 const (
-       JavaStringHash HashingScheme = 0 // Java String.hashCode() equivalent
-       Murmur3_32Hash HashingScheme = 1 // Use Murmur3 hashing function
-       BoostHash      HashingScheme = 2 // C++ based boost::hash
+       JavaStringHash HashingScheme = iota // Java String.hashCode() equivalent
+       Murmur3_32Hash                      // Use Murmur3 hashing function
+       BoostHash                           // C++ based boost::hash
 )
 
 type CompressionType int
 
 const (
-       NoCompression CompressionType = 0
-       LZ4           CompressionType = 1
-       ZLib          CompressionType = 2
-       ZSTD          CompressionType = 3
+       NoCompression CompressionType = iota
+       LZ4
+       ZLib
+       ZSTD
 )
 
 type TopicMetadata interface {

Reply via email to