chore(inputs.prometheus): Fix linter warnings (#14777)

This commit is contained in:
Sven Rebhan 2024-02-13 01:55:34 +01:00 committed by GitHub
parent 059f709c12
commit 2cd12adcd7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 3 deletions

View File

@ -591,7 +591,7 @@ func TestPrometheusInternalOk(t *testing.T) {
prommetric := `# HELP test_counter A sample test counter.
# TYPE test_counter counter
test_counter{label="test"} 1 1685443805885`
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
_, err := fmt.Fprintln(w, prommetric)
require.NoError(t, err)
}))
@ -632,7 +632,7 @@ func TestPrometheusInternalContentBadFormat(t *testing.T) {
prommetric := `# HELP test_counter A sample test counter.
# TYPE test_counter counter
<body>Flag test</body>`
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
_, err := fmt.Fprintln(w, prommetric)
require.NoError(t, err)
}))
@ -668,7 +668,7 @@ func TestPrometheusInternalContentBadFormat(t *testing.T) {
}
func TestPrometheusInternalNoWeb(t *testing.T) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
w.WriteHeader(404)
}))
defer ts.Close()