From 5992fc47ac7594905e78e41f7c93113b8a345137 Mon Sep 17 00:00:00 2001 From: William Wilson Date: Mon, 21 Mar 2022 11:11:25 -0500 Subject: [PATCH] tests: remove redundant newlines that go 1.18 treats as errors (#10847) --- internal/usage.go | 3 +-- internal/usage_windows.go | 3 +-- plugins/inputs/prometheus/prometheus_test.go | 15 +++++++-------- plugins/inputs/solr/testdata3_test.go | 3 +-- plugins/inputs/solr/testdata7_test.go | 3 +-- plugins/inputs/solr/testdata_test.go | 9 +++------ 6 files changed, 14 insertions(+), 22 deletions(-) diff --git a/internal/usage.go b/internal/usage.go index a650a4854..3e6e4fb14 100644 --- a/internal/usage.go +++ b/internal/usage.go @@ -63,5 +63,4 @@ Examples: telegraf --config telegraf.conf --input-filter cpu:mem --output-filter influxdb # run telegraf with pprof - telegraf --config telegraf.conf --pprof-addr localhost:6060 -` + telegraf --config telegraf.conf --pprof-addr localhost:6060` diff --git a/internal/usage_windows.go b/internal/usage_windows.go index c85f944d2..511bd5ca4 100644 --- a/internal/usage_windows.go +++ b/internal/usage_windows.go @@ -77,5 +77,4 @@ Examples: telegraf --service install --service-name=my-telegraf --service-display-name="My Telegraf" # install telegraf service with auto restart and restart delay of 3 minutes - telegraf --service install --service-auto-restart --service-restart-delay 3m - ` + telegraf --service install --service-auto-restart --service-restart-delay 3m` diff --git a/plugins/inputs/prometheus/prometheus_test.go b/plugins/inputs/prometheus/prometheus_test.go index f56cfef8f..0e1049051 100644 --- a/plugins/inputs/prometheus/prometheus_test.go +++ b/plugins/inputs/prometheus/prometheus_test.go @@ -31,8 +31,8 @@ go_gc_duration_seconds_count 7 go_goroutines 15 # HELP test_metric An untyped metric with a timestamp # TYPE test_metric untyped -test_metric{label="value"} 1.0 1490802350000 -` +test_metric{label="value"} 1.0 1490802350000` + const sampleSummaryTextFormat = `# HELP go_gc_duration_seconds A summary of the GC invocation durations. # TYPE go_gc_duration_seconds summary go_gc_duration_seconds{quantile="0"} 0.00010425500000000001 @@ -41,13 +41,12 @@ go_gc_duration_seconds{quantile="0.5"} 0.00015749400000000002 go_gc_duration_seconds{quantile="0.75"} 0.000331463 go_gc_duration_seconds{quantile="1"} 0.000667154 go_gc_duration_seconds_sum 0.0018183950000000002 -go_gc_duration_seconds_count 7 -` +go_gc_duration_seconds_count 7` + const sampleGaugeTextFormat = ` # HELP go_goroutines Number of goroutines that currently exist. # TYPE go_goroutines gauge -go_goroutines 15 1490802350000 -` +go_goroutines 15 1490802350000` func TestPrometheusGeneratesMetrics(t *testing.T) { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { @@ -161,8 +160,8 @@ func TestSummaryMayContainNaN(t *testing.T) { go_gc_duration_seconds{quantile="0"} NaN go_gc_duration_seconds{quantile="1"} NaN go_gc_duration_seconds_sum 42.0 -go_gc_duration_seconds_count 42 -` +go_gc_duration_seconds_count 42` + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { _, err := fmt.Fprintln(w, data) require.NoError(t, err) diff --git a/plugins/inputs/solr/testdata3_test.go b/plugins/inputs/solr/testdata3_test.go index cc5a4960d..308333534 100644 --- a/plugins/inputs/solr/testdata3_test.go +++ b/plugins/inputs/solr/testdata3_test.go @@ -727,8 +727,7 @@ const mBeansSolr3MainResponse = `{ } } ] -} -` +}` var solr3CoreExpected = map[string]interface{}{ "num_docs": int64(117166), diff --git a/plugins/inputs/solr/testdata7_test.go b/plugins/inputs/solr/testdata7_test.go index b58b3f131..b8beb8948 100644 --- a/plugins/inputs/solr/testdata7_test.go +++ b/plugins/inputs/solr/testdata7_test.go @@ -41,8 +41,7 @@ const mBeansSolr7Response = ` } } ] -} -` +}` var solr7CacheExpected = map[string]interface{}{ "evictions": int64(141485), diff --git a/plugins/inputs/solr/testdata_test.go b/plugins/inputs/solr/testdata_test.go index 30ae0127a..19fa1b163 100644 --- a/plugins/inputs/solr/testdata_test.go +++ b/plugins/inputs/solr/testdata_test.go @@ -62,8 +62,7 @@ const statusResponse = ` "QTime": 13, "status": 0 } -} -` +}` const mBeansMainResponse = `{ "solr-mbeans": [ @@ -905,8 +904,7 @@ const mBeansMainResponse = `{ "QTime": 8, "status": 0 } -} -` +}` const mBeansCore1Response = `{ "solr-mbeans": [ @@ -1748,8 +1746,7 @@ const mBeansCore1Response = `{ "QTime": 5, "status": 0 } -} -` +}` var solrAdminMainCoreStatusExpected = map[string]interface{}{ "num_docs": int64(168943425),