diff --git a/fcm.go b/fcm.go index c4d4108..5fb7e05 100644 --- a/fcm.go +++ b/fcm.go @@ -327,13 +327,18 @@ func makeSendResponseFromPart(part *multipart.Part) (SendResponse, error) { func (c *Client) SendEach(ctx context.Context, messages []Message) (MessageMultiSendResponse, error) { - _, span := tracer.Start(ctx, "Client.SendEach") + ctx, span := tracer.Start(ctx, "Client.SendEach") defer span.End() - return c.doSendEachInBatch(messages, false) + return c.doSendEachInBatch(ctx, messages, false) } -func (c *Client) doSendEachInBatch(messages []Message, validateOnly bool) (MessageMultiSendResponse, error) { +func (c *Client) doSendEachInBatch( + ctx context.Context, + messages []Message, + validateOnly bool, +) (MessageMultiSendResponse, error) { + messageCount := len(messages) if messageCount == 0 { return MessageMultiSendResponse{}, nil