Skip to content

Commit

Permalink
feat(sms): fix lint
Browse files Browse the repository at this point in the history
Signed-off-by: Flc゛ <[email protected]>
  • Loading branch information
flc1125 committed Jan 10, 2024
1 parent ada18a4 commit d46aa4f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
1 change: 0 additions & 1 deletion sms/mitake/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func TestProvider(t *testing.T) {
}, &sms.Message{
Text: text,
})

if err != nil {
t.Fatal(err)
}
Expand Down
3 changes: 1 addition & 2 deletions sms/null_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ package sms

import "context"

type NullProvider struct {
}
type NullProvider struct{}

func NewNullProvider() Provider {
return &NullProvider{}
Expand Down
2 changes: 1 addition & 1 deletion sms/sms.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 7 additions & 5 deletions sms/sms_test.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
package sms

import (
"context"
"testing"

"github.com/stretchr/testify/assert"
)

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))
}

0 comments on commit d46aa4f

Please sign in to comment.