diff --git a/sms/mitake/provider_test.go b/sms/mitake/provider_test.go index 83fed91..a50e755 100644 --- a/sms/mitake/provider_test.go +++ b/sms/mitake/provider_test.go @@ -51,7 +51,6 @@ func TestProvider(t *testing.T) { }, &sms.Message{ Text: text, }) - if err != nil { t.Fatal(err) } diff --git a/sms/null_provider.go b/sms/null_provider.go index dc7dd1b..442d6d8 100644 --- a/sms/null_provider.go +++ b/sms/null_provider.go @@ -2,8 +2,7 @@ package sms import "context" -type NullProvider struct { -} +type NullProvider struct{} func NewNullProvider() Provider { return &NullProvider{} diff --git a/sms/sms.go b/sms/sms.go index 54c3e23..d7cafea 100644 --- a/sms/sms.go +++ b/sms/sms.go @@ -56,7 +56,7 @@ func (s *Sms) SendTextWithNumber(ctx context.Context, phoneNumber, text string) }, text) } -func (s *Sms) SendTemplateWithNumber(ctx context.Context, phoneNumber, template string, variables map[string]string) error { +func (s *Sms) SendTemplateWithNumber(ctx context.Context, phoneNumber, template string, variables map[string]string) error { //nolint:lll return s.SendTemplate(ctx, &Phone{ Number: phoneNumber, }, template, variables) diff --git a/sms/sms_test.go b/sms/sms_test.go index b3d9208..f91af16 100644 --- a/sms/sms_test.go +++ b/sms/sms_test.go @@ -1,6 +1,7 @@ package sms import ( + "context" "testing" "github.com/stretchr/testify/assert" @@ -8,10 +9,11 @@ import ( func TestSms(t *testing.T) { sms := New(NewNullProvider()) + ctx := context.Background() - assert.NoError(t, sms.Send(nil, nil, nil)) - assert.NoError(t, sms.SendText(nil, nil, "")) - assert.NoError(t, sms.SendTemplate(nil, nil, "", nil)) - assert.NoError(t, sms.SendTextWithNumber(nil, "", "")) - assert.NoError(t, sms.SendTemplateWithNumber(nil, "", "", nil)) + assert.NoError(t, sms.Send(ctx, nil, nil)) + assert.NoError(t, sms.SendText(ctx, nil, "")) + assert.NoError(t, sms.SendTemplate(ctx, nil, "", nil)) + assert.NoError(t, sms.SendTextWithNumber(ctx, "", "")) + assert.NoError(t, sms.SendTemplateWithNumber(ctx, "", "", nil)) }