Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb349760

Browse files
committed
make lint/fmt
Signed-off-by: Danny Kopping <danny@coder.com>
1 parentce9dcaf commitb349760

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

‎coderd/notifications/notifications_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -748,12 +748,12 @@ func TestCustomNotificationMethod(t *testing.T) {
748748

749749
// GIVEN: a notification template which has a method explicitly set
750750
var (
751-
template=notifications.TemplateWorkspaceDormant
751+
template=notifications.TemplateWorkspaceDormant
752752
defaultMethod=database.NotificationMethodSmtp
753-
customMethod=database.NotificationMethodWebhook
753+
customMethod=database.NotificationMethodWebhook
754754
)
755755
out,err:=db.UpdateNotificationTemplateMethodByID(ctx, database.UpdateNotificationTemplateMethodByIDParams{
756-
ID:template,
756+
ID:template,
757757
Method: database.NullNotificationMethod{NotificationMethod:customMethod,Valid:true},
758758
})
759759
require.NoError(t,err)
@@ -762,8 +762,8 @@ func TestCustomNotificationMethod(t *testing.T) {
762762
// GIVEN: a manager configured with multiple dispatch methods
763763
cfg:=defaultNotificationsConfig(defaultMethod)
764764
cfg.SMTP= codersdk.NotificationsEmailConfig{
765-
From:"danny@coder.com",
766-
Hello:"localhost",
765+
From:"danny@coder.com",
766+
Hello:"localhost",
767767
Smarthost: serpent.HostPort{Host:"localhost",Port:fmt.Sprintf("%d",mockSMTPSrv.PortNumber())},
768768
}
769769
cfg.Webhook= codersdk.NotificationsWebhookConfig{
@@ -782,6 +782,7 @@ func TestCustomNotificationMethod(t *testing.T) {
782782
// WHEN: a notification of that template is enqueued, it should be delivered with the configured method - not the default.
783783
user:=createSampleUser(t,db)
784784
msgID,err:=enq.Enqueue(ctx,user.ID,template,map[string]string{},"test")
785+
require.NoError(t,err)
785786

786787
// THEN: the notification should be received by the custom dispatch method
787788
mgr.Run(ctx)

‎coderd/notifications/notifier.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,21 +33,21 @@ type notifier struct {
3333
quitchanany
3434
donechanany
3535

36-
handlersmap[database.NotificationMethod]Handler
36+
handlersmap[database.NotificationMethod]Handler
3737
metrics*Metrics
3838
}
3939

4040
funcnewNotifier(cfg codersdk.NotificationsConfig,id uuid.UUID,log slog.Logger,dbStore,hrmap[database.NotificationMethod]Handler,metrics*Metrics)*notifier {
4141
return&notifier{
42-
id:id,
43-
cfg:cfg,
44-
log:log.Named("notifier").With(slog.F("notifier_id",id)),
45-
quit:make(chanany),
46-
done:make(chanany),
47-
tick:time.NewTicker(cfg.FetchInterval.Value()),
48-
store:db,
49-
handlers:hr,
50-
metrics:metrics,
42+
id:id,
43+
cfg:cfg,
44+
log:log.Named("notifier").With(slog.F("notifier_id",id)),
45+
quit:make(chanany),
46+
done:make(chanany),
47+
tick:time.NewTicker(cfg.FetchInterval.Value()),
48+
store:db,
49+
handlers:hr,
50+
metrics:metrics,
5151
}
5252
}
5353

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp