From commits-return-40137-archive-asf-public=cust-asf.ponee.io@pulsar.apache.org Thu Oct 24 10:22:51 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id 75E5018065D for ; Thu, 24 Oct 2019 12:22:51 +0200 (CEST) Received: (qmail 60624 invoked by uid 500); 24 Oct 2019 10:22:50 -0000 Mailing-List: contact commits-help@pulsar.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pulsar.apache.org Delivered-To: mailing list commits@pulsar.apache.org Received: (qmail 60614 invoked by uid 99); 24 Oct 2019 10:22:50 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Oct 2019 10:22:50 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 9D4AB80B20; Thu, 24 Oct 2019 10:22:50 +0000 (UTC) Date: Thu, 24 Oct 2019 10:22:50 +0000 To: "commits@pulsar.apache.org" Subject: [pulsar-client-go] branch master updated: refactor: gofmt code (#75) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <157191257059.29607.850919545371452145@gitbox.apache.org> From: rxl@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: pulsar-client-go X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 8a2ff054d85bcbdba433b18639745920bbabc64c X-Git-Newrev: 84fb5765f1e817a2e2bdcafedcc73095c4c2f2c2 X-Git-Rev: 84fb5765f1e817a2e2bdcafedcc73095c4c2f2c2 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated This is an automated email from the ASF dual-hosted git repository. rxl pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git The following commit(s) were added to refs/heads/master by this push: new 84fb576 refactor: gofmt code (#75) 84fb576 is described below commit 84fb5765f1e817a2e2bdcafedcc73095c4c2f2c2 Author: xujianhai666 <52450794+xujianhai666@users.noreply.github.com> AuthorDate: Thu Oct 24 18:13:24 2019 +0800 refactor: gofmt code (#75) Motivation: code is not fmt, should be with gofmt Modifications: - gofmt once Fixes #74 Change-Id: Ic4eb14080bb0da22be418ff1385d90209f2b9d27 --- examples/consumer-listener/consumer-listener.go | 62 ++++++++++++------------- examples/consumer/consumer.go | 2 +- 2 files changed, 32 insertions(+), 32 deletions(-) diff --git a/examples/consumer-listener/consumer-listener.go b/examples/consumer-listener/consumer-listener.go index c20d731..0a8e6c9 100644 --- a/examples/consumer-listener/consumer-listener.go +++ b/examples/consumer-listener/consumer-listener.go @@ -18,47 +18,47 @@ package main import ( - "fmt" - "log" + "fmt" + "log" - "github.com/apache/pulsar-client-go/pulsar" + "github.com/apache/pulsar-client-go/pulsar" ) func main() { - client, err := pulsar.NewClient(pulsar.ClientOptions{URL: "pulsar://localhost:6650"}) - if err != nil { - log.Fatal(err) - } + client, err := pulsar.NewClient(pulsar.ClientOptions{URL: "pulsar://localhost:6650"}) + if err != nil { + log.Fatal(err) + } - defer client.Close() + defer client.Close() - channel := make(chan pulsar.ConsumerMessage, 100) + channel := make(chan pulsar.ConsumerMessage, 100) - options := pulsar.ConsumerOptions{ - Topic: "topic-1", - SubscriptionName: "my-subscription", - Type: pulsar.Shared, - } + options := pulsar.ConsumerOptions{ + Topic: "topic-1", + SubscriptionName: "my-subscription", + Type: pulsar.Shared, + } - options.MessageChannel = channel + options.MessageChannel = channel - consumer, err := client.Subscribe(options) - if err != nil { - log.Fatal(err) - } + consumer, err := client.Subscribe(options) + if err != nil { + log.Fatal(err) + } - defer consumer.Close() + defer consumer.Close() - // Receive messages from channel. The channel returns a struct which contains message and the consumer from where - // the message was received. It's not necessary here since we have 1 single consumer, but the channel could be - // shared across multiple consumers as well - for cm := range channel { - msg := cm.Message - fmt.Printf("Received message msgId: %v -- content: '%s'\n", - msg.ID(), string(msg.Payload())) + // Receive messages from channel. The channel returns a struct which contains message and the consumer from where + // the message was received. It's not necessary here since we have 1 single consumer, but the channel could be + // shared across multiple consumers as well + for cm := range channel { + msg := cm.Message + fmt.Printf("Received message msgId: %v -- content: '%s'\n", + msg.ID(), string(msg.Payload())) - if err := consumer.Ack(msg); err != nil { - log.Fatal(err) - } - } + if err := consumer.Ack(msg); err != nil { + log.Fatal(err) + } + } } diff --git a/examples/consumer/consumer.go b/examples/consumer/consumer.go index c408386..5250a02 100644 --- a/examples/consumer/consumer.go +++ b/examples/consumer/consumer.go @@ -22,7 +22,7 @@ import ( "fmt" "log" - "github.com/apache/pulsar-client-go/pulsar" + "github.com/apache/pulsar-client-go/pulsar" ) func main() {