From e0bfc7f0d0b130227f4262b5a9d141997674cd2d Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 24 May 2020 01:41:24 -0400 Subject: [PATCH] Updates for the latest zap. --- smtp/relay.go | 6 +++--- smtp/relay_test.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/smtp/relay.go b/smtp/relay.go index f709ce1..dc26f19 100644 --- a/smtp/relay.go +++ b/smtp/relay.go @@ -11,10 +11,10 @@ import ( "net" "net/smtp" - "github.com/uber-go/zap" + "go.uber.org/zap" ) -func RelayMessage(server Server, env Envelope, log zap.Logger) { +func RelayMessage(server Server, env Envelope, log *zap.Logger) { for _, rcptTo := range env.RcptTo { sendLog := log.With(zap.String("address", rcptTo.Address)) @@ -31,7 +31,7 @@ func RelayMessage(server Server, env Envelope, log zap.Logger) { } } -func relayMessageToHost(server Server, env Envelope, log zap.Logger, to, host string) { +func relayMessageToHost(server Server, env Envelope, log *zap.Logger, to, host string) { from := env.MailFrom.Address c, err := smtp.Dial(host) diff --git a/smtp/relay_test.go b/smtp/relay_test.go index bfd3724..31d0d22 100644 --- a/smtp/relay_test.go +++ b/smtp/relay_test.go @@ -11,7 +11,7 @@ import ( "net/mail" "testing" - "github.com/uber-go/zap" + "go.uber.org/zap" ) type deliveryServer struct { @@ -38,7 +38,7 @@ func TestRelayRoundTrip(t *testing.T) { ID: "ididid", } - relayMessageToHost(s, env, zap.New(zap.NullEncoder()), env.RcptTo[0].Address, l.Addr().String()) + relayMessageToHost(s, env, zap.NewNop(), env.RcptTo[0].Address, l.Addr().String()) if len(s.messages) != 1 { t.Errorf("Expected 1 message to be delivered, got %d", len(s.messages)) -- 2.43.5