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

Commit7c9356f

Browse files
committed
Fix lint
1 parent86ee7f2 commit7c9356f

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

‎cli/exp_scaletest.go‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1930,7 +1930,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
19301930
notificationTimeout time.Duration
19311931
dialTimeout time.Duration
19321932
noCleanupbool
1933-
smtpApiUrlstring
1933+
smtpAPIURLstring
19341934

19351935
tracingFlags=&scaletestTracingFlags{}
19361936

@@ -1977,8 +1977,8 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
19771977
returnxerrors.Errorf("--owner-user-percentage must be between 0 and 100")
19781978
}
19791979

1980-
ifsmtpApiUrl!="" {
1981-
if!strings.HasPrefix(smtpApiUrl,"http://")&&!strings.HasPrefix(smtpApiUrl,"https://") {
1980+
ifsmtpAPIURL!="" {
1981+
if!strings.HasPrefix(smtpAPIURL,"http://")&&!strings.HasPrefix(smtpAPIURL,"https://") {
19821982
returnxerrors.Errorf("smtp_api_url must start with http:// or https://")
19831983
}
19841984
}
@@ -2047,7 +2047,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
20472047
ReceivingWatchBarrier:ownerWatchBarrier,
20482048
ExpectedNotifications:expectedNotifications,
20492049
Metrics:metrics,
2050-
SMTPApiUrl:smtpApiUrl,
2050+
SMTPApiURL:smtpAPIURL,
20512051
}
20522052
iferr:=config.Validate();err!=nil {
20532053
returnxerrors.Errorf("validate config: %w",err)
@@ -2065,7 +2065,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
20652065
DialBarrier:dialBarrier,
20662066
ReceivingWatchBarrier:ownerWatchBarrier,
20672067
Metrics:metrics,
2068-
SMTPApiUrl:smtpApiUrl,
2068+
SMTPApiURL:smtpAPIURL,
20692069
}
20702070
iferr:=config.Validate();err!=nil {
20712071
returnxerrors.Errorf("validate config: %w",err)
@@ -2179,7 +2179,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
21792179
Flag:"smtp-api-url",
21802180
Env:"CODER_SCALETEST_SMTP_API_URL",
21812181
Description:"SMTP mock HTTP API address.",
2182-
Value:serpent.StringOf(&smtpApiUrl),
2182+
Value:serpent.StringOf(&smtpAPIURL),
21832183
},
21842184
}
21852185

‎scaletest/notifications/config.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type Config struct {
3737
ReceivingWatchBarrier*sync.WaitGroup`json:"-"`
3838

3939
// SMTPApiUrl is the URL of the SMTP mock HTTP API
40-
SMTPApiUrlstring`json:"smtp_api_url"`
40+
SMTPApiURLstring`json:"smtp_api_url"`
4141
}
4242

4343
func (cConfig)Validate()error {

‎scaletest/notifications/run.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ func (r *Runner) Run(ctx context.Context, id string, logs io.Writer) error {
151151
returnr.watchNotifications(egCtx,conn,newUser,logger,r.cfg.ExpectedNotifications)
152152
})
153153

154-
ifr.cfg.SMTPApiUrl!="" {
154+
ifr.cfg.SMTPApiURL!="" {
155155
logger.Info(ctx,"running SMTP notification watcher")
156156
eg.Go(func()error {
157157
returnr.watchNotificationsSMTP(egCtx,newUser,logger,r.cfg.ExpectedNotifications)
@@ -305,7 +305,7 @@ func (r *Runner) watchNotificationsSMTP(ctx context.Context, user codersdk.User,
305305
ticker:=time.NewTicker(smtpPollInterval)
306306
deferticker.Stop()
307307

308-
apiURL:=fmt.Sprintf("%s/messages?email=%s",r.cfg.SMTPApiUrl,user.Email)
308+
apiURL:=fmt.Sprintf("%s/messages?email=%s",r.cfg.SMTPApiURL,user.Email)
309309
httpClient:=&http.Client{
310310
Timeout:10*time.Second,
311311
}
@@ -335,20 +335,20 @@ func (r *Runner) watchNotificationsSMTP(ctx context.Context, user codersdk.User,
335335
}
336336

337337
ifresp.StatusCode!=http.StatusOK {
338-
resp.Body.Close()
338+
_=resp.Body.Close()
339339
logger.Error(ctx,"smtp api returned non-200 status",slog.F("status",resp.StatusCode))
340340
r.cfg.Metrics.AddError(user.Username,"smtp_bad_status")
341341
returnxerrors.Errorf("smtp api returned status %d",resp.StatusCode)
342342
}
343343

344344
varsummaries []smtpmock.EmailSummary
345345
iferr:=json.NewDecoder(resp.Body).Decode(&summaries);err!=nil {
346-
resp.Body.Close()
346+
_=resp.Body.Close()
347347
logger.Error(ctx,"decode smtp api response",slog.Error(err))
348348
r.cfg.Metrics.AddError(user.Username,"smtp_decode")
349349
returnxerrors.Errorf("decode smtp api response: %w",err)
350350
}
351-
resp.Body.Close()
351+
_=resp.Body.Close()
352352

353353
// Process each email summary
354354
for_,summary:=rangesummaries {

‎scaletest/notifications/run_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ func TestRunWithSMTP(t *testing.T) {
255255
DialBarrier:dialBarrier,
256256
ReceivingWatchBarrier:receivingWatchBarrier,
257257
ExpectedNotifications:expectedNotifications,
258-
SMTPApiAddr:smtpSrv.APIAddress(),
258+
SMTPApiURL:smtpSrv.APIAddress(),
259259
}
260260
err:=runnerCfg.Validate()
261261
require.NoError(t,err)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp