You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2019/05/14 16:34:09 UTC

[pulsar-client-go] 32/38: Addressed comments

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

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git

commit 617f0d5647347d16e15df8e9db7a6d852df54d38
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Tue May 7 13:16:16 2019 -0700

    Addressed comments
---
 pulsar/error.go                         |  1 -
 pulsar/impl/backoff.go                  |  6 ++++--
 pulsar/impl/batch_builder.go            | 10 +++++-----
 pulsar/{util_test.go => test_helper.go} |  0
 4 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/pulsar/error.go b/pulsar/error.go
index 24e1536..38b9d64 100644
--- a/pulsar/error.go
+++ b/pulsar/error.go
@@ -19,7 +19,6 @@
 
 package pulsar
 
-import "C"
 import "fmt"
 
 type Result int
diff --git a/pulsar/impl/backoff.go b/pulsar/impl/backoff.go
index afd6c4f..3e7629e 100644
--- a/pulsar/impl/backoff.go
+++ b/pulsar/impl/backoff.go
@@ -27,8 +27,10 @@ type Backoff struct {
 	backoff time.Duration
 }
 
-const minBackoff = 100 * time.Millisecond
-const maxBackoff = 60 * time.Second
+const (
+	minBackoff = 100 * time.Millisecond
+	maxBackoff = 60 * time.Second
+)
 
 func (b *Backoff) Next() time.Duration {
 	// Double the delay each time
diff --git a/pulsar/impl/batch_builder.go b/pulsar/impl/batch_builder.go
index 0cb19f0..a3b41a2 100644
--- a/pulsar/impl/batch_builder.go
+++ b/pulsar/impl/batch_builder.go
@@ -27,11 +27,11 @@ import (
 	"time"
 )
 
-const MaxMessageSize = 5 * 1024 * 1024
-
-const MaxBatchSize = 128 * 1024
-
-const DefaultMaxMessagesPerBatch = 1000
+const (
+	MaxMessageSize = 5 * 1024 * 1024
+	MaxBatchSize = 128 * 1024
+	DefaultMaxMessagesPerBatch = 1000
+)
 
 type BatchBuilder struct {
 	buffer Buffer
diff --git a/pulsar/util_test.go b/pulsar/test_helper.go
similarity index 100%
rename from pulsar/util_test.go
rename to pulsar/test_helper.go