You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/09/05 05:06:10 UTC

[GitHub] [pulsar] labuladong commented on a diff in pull request #17455: [improve][doc] Improve golang client doc

labuladong commented on code in PR #17455:
URL: https://github.com/apache/pulsar/pull/17455#discussion_r962480492


##########
site2/docs/client-libraries-go.md:
##########
@@ -846,43 +868,43 @@ ctx := context.Background()
 
 // create producer
 producer, err := client.CreateProducer(pulsar.ProducerOptions{
-	Topic:           topic,
-	DisableBatching: true,
+    Topic:           topic,
+    DisableBatching: true,
 })
 if err != nil {
-	log.Fatal(err)
+    log.Fatal(err)
 }
 defer producer.Close()
 
 // send 10 messages
-msgIDs := [10]MessageID{}
+msgIDs := [10]pulsar.MessageID{}
 for i := 0; i < 10; i++ {
-	msgID, err := producer.Send(ctx, &pulsar.ProducerMessage{
-		Payload: []byte(fmt.Sprintf("hello-%d", i)),
-	})
-	assert.NoError(t, err)
-	assert.NotNil(t, msgID)
-	msgIDs[i] = msgID
+    msgID, _ := producer.Send(ctx, &pulsar.ProducerMessage{

Review Comment:
   Seems that the original code snippet is copied from the test cases, which is unnecessary in the documentation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org