Skip to content

Commit af1d9f8

Browse files
committed
Linting
1 parent f5f8649 commit af1d9f8

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

http/client_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -458,13 +458,13 @@ func TestSendWebhookOAuth2(t *testing.T) {
458458

459459
oauth2Server := httptest.NewServer(http.HandlerFunc(oauthHandler))
460460
defer oauth2Server.Close()
461-
tokenUrl := oauth2Server.URL + "/oauth2/token"
461+
tokenURL := oauth2Server.URL + "/oauth2/token"
462462

463463
proxyRequestCnt := 0
464464
proxyServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
465465
proxyRequestCnt++
466466
// Verify this is a proxy request.
467-
assert.Equal(t, tokenUrl, r.RequestURI, "expected request to be sent to oauth server")
467+
assert.Equal(t, tokenURL, r.RequestURI, "expected request to be sent to oauth server")
468468

469469
// Simulate forwarding the request to the OAuth2 handler.
470470
oauthHandler(w, r)
@@ -481,7 +481,7 @@ func TestSendWebhookOAuth2(t *testing.T) {
481481
defer webhookServer.Close()
482482

483483
oauthConfig := tc.oauth2Config
484-
oauthConfig.TokenURL = tokenUrl
484+
oauthConfig.TokenURL = tokenURL
485485

486486
if oauthConfig.ProxyConfig != nil && oauthConfig.ProxyConfig.ProxyURL != "" {
487487
oauthConfig.ProxyConfig.ProxyURL = proxyServer.URL

http/config.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ var (
1919
)
2020

2121
// HTTPClientConfig holds common configuration for notifier HTTP clients.
22+
//
23+
//nolint:revive
2224
type HTTPClientConfig struct {
2325
// The OAuth2 client credentials used to fetch a token for the targets.
2426
OAuth2 *OAuth2Config `yaml:"oauth2,omitempty" json:"oauth2,omitempty"`
@@ -68,16 +70,16 @@ func (cfg *ProxyConfig) Proxy() (fn func(*http.Request) (*url.URL, error), err e
6870
}, nil
6971
}
7072
if cfg.ProxyURL != "" {
71-
proxyUrl, err := url.Parse(cfg.ProxyURL)
73+
proxyURL, err := url.Parse(cfg.ProxyURL)
7274
if err != nil {
7375
return nil, fmt.Errorf("invalid proxy URL %q: %w", cfg.ProxyURL, err)
7476
}
7577
if cfg.NoProxy == "" {
76-
return http.ProxyURL(proxyUrl), nil
78+
return http.ProxyURL(proxyURL), nil
7779
}
7880
proxy := &httpproxy.Config{
79-
HTTPProxy: proxyUrl.String(),
80-
HTTPSProxy: proxyUrl.String(),
81+
HTTPProxy: proxyURL.String(),
82+
HTTPSProxy: proxyURL.String(),
8183
NoProxy: cfg.NoProxy,
8284
}
8385
proxyFn := proxy.ProxyFunc()

notify/factory.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func BuildReceiverIntegrations(
8888
})
8989
}
9090
for i, cfg := range receiver.EmailConfigs {
91-
ci(i, cfg.Metadata, func(cli *http.Client) notificationChannel {
91+
ci(i, cfg.Metadata, func(_ *http.Client) notificationChannel {
9292
return email.New(cfg.Settings, cfg.Metadata, tmpl, emailSender, img, logger)
9393
})
9494
}
@@ -113,7 +113,7 @@ func BuildReceiverIntegrations(
113113
})
114114
}
115115
for i, cfg := range receiver.MqttConfigs {
116-
ci(i, cfg.Metadata, func(cli *http.Client) notificationChannel {
116+
ci(i, cfg.Metadata, func(_ *http.Client) notificationChannel {
117117
return mqtt.New(cfg.Settings, cfg.Metadata, tmpl, logger, nil)
118118
})
119119
}
@@ -143,7 +143,9 @@ func BuildReceiverIntegrations(
143143
})
144144
}
145145
for i, cfg := range receiver.SNSConfigs {
146-
ci(i, cfg.Metadata, func(cli *http.Client) notificationChannel { return sns.New(cfg.Settings, cfg.Metadata, tmpl, logger) })
146+
ci(i, cfg.Metadata, func(_ *http.Client) notificationChannel {
147+
return sns.New(cfg.Settings, cfg.Metadata, tmpl, logger)
148+
})
147149
}
148150
for i, cfg := range receiver.SlackConfigs {
149151
ci(i, cfg.Metadata, func(cli *http.Client) notificationChannel {

0 commit comments

Comments
 (0)