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

Commite91a6a1

Browse files
committed
Fix lint
1 parentc3f5cf1 commite91a6a1

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
@@ -1929,7 +1929,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
19291929
notificationTimeout time.Duration
19301930
dialTimeout time.Duration
19311931
noCleanupbool
1932-
smtpApiUrlstring
1932+
smtpAPIURLstring
19331933

19341934
tracingFlags=&scaletestTracingFlags{}
19351935

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

1979-
ifsmtpApiUrl!="" {
1980-
if!strings.HasPrefix(smtpApiUrl,"http://")&&!strings.HasPrefix(smtpApiUrl,"https://") {
1979+
ifsmtpAPIURL!="" {
1980+
if!strings.HasPrefix(smtpAPIURL,"http://")&&!strings.HasPrefix(smtpAPIURL,"https://") {
19811981
returnxerrors.Errorf("smtp_api_url must start with http:// or https://")
19821982
}
19831983
}
@@ -2046,7 +2046,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
20462046
ReceivingWatchBarrier:ownerWatchBarrier,
20472047
ExpectedNotifications:expectedNotifications,
20482048
Metrics:metrics,
2049-
SMTPApiUrl:smtpApiUrl,
2049+
SMTPApiURL:smtpAPIURL,
20502050
}
20512051
iferr:=config.Validate();err!=nil {
20522052
returnxerrors.Errorf("validate config: %w",err)
@@ -2064,7 +2064,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
20642064
DialBarrier:dialBarrier,
20652065
ReceivingWatchBarrier:ownerWatchBarrier,
20662066
Metrics:metrics,
2067-
SMTPApiUrl:smtpApiUrl,
2067+
SMTPApiURL:smtpAPIURL,
20682068
}
20692069
iferr:=config.Validate();err!=nil {
20702070
returnxerrors.Errorf("validate config: %w",err)
@@ -2178,7 +2178,7 @@ func (r *RootCmd) scaletestNotifications() *serpent.Command {
21782178
Flag:"smtp-api-url",
21792179
Env:"CODER_SCALETEST_SMTP_API_URL",
21802180
Description:"SMTP mock HTTP API address.",
2181-
Value:serpent.StringOf(&smtpApiUrl),
2181+
Value:serpent.StringOf(&smtpAPIURL),
21822182
},
21832183
}
21842184

‎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