From 82bdb092f0e4bb1c7c58cacafd33e8e6b8f0d9ed Mon Sep 17 00:00:00 2001 From: Haris Chaniotakis Date: Fri, 12 Feb 2021 10:29:23 +0200 Subject: [PATCH] refactor: remove unnecessary variable assignments --- service/sendgrid/sendgrid.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/service/sendgrid/sendgrid.go b/service/sendgrid/sendgrid.go index 690e1a3..ecc4be5 100644 --- a/service/sendgrid/sendgrid.go +++ b/service/sendgrid/sendgrid.go @@ -21,10 +21,8 @@ type SendGrid struct { // You will need a SendGrid API key. // See https://sendgrid.com/docs/for-developers/sending-email/api-getting-started/ func New(apiKey, senderAddress, senderName string) *SendGrid { - client := sendgrid.NewSendClient(apiKey) - return &SendGrid{ - client: client, + client: sendgrid.NewSendClient(apiKey), senderAddress: senderAddress, senderName: senderName, receiverAddresses: []string{}, @@ -48,8 +46,7 @@ func (s SendGrid) Send(subject, message string) error { p.Subject = subject for _, receiverAddress := range s.receiverAddresses { - receiverEmail := mail.NewEmail(receiverAddress, receiverAddress) - p.AddTos(receiverEmail) + p.AddTos(mail.NewEmail(receiverAddress, receiverAddress)) } m := mail.NewV3Mail()