From ee84be3e5a41ad25fd1dc4a16be0c39a588b98d7 Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Tue, 22 Jun 2021 17:38:59 -0700 Subject: [PATCH] Run gofumports in the project --- client/nginx_test.go | 2 +- collector/helper.go | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/nginx_test.go b/client/nginx_test.go index cda5062..04a3bf6 100644 --- a/client/nginx_test.go +++ b/client/nginx_test.go @@ -5,7 +5,7 @@ import "testing" const validStabStats = "Active connections: 1457 \nserver accepts handled requests\n 6717066 6717066 65844359 \nReading: 1 Writing: 8 Waiting: 1448 \n" func TestParseStubStatsValidInput(t *testing.T) { - var tests = []struct { + tests := []struct { input []byte expectedResult StubStats expectedError bool diff --git a/collector/helper.go b/collector/helper.go index 305efde..9eb6315 100644 --- a/collector/helper.go +++ b/collector/helper.go @@ -4,8 +4,10 @@ import ( "github.com/prometheus/client_golang/prometheus" ) -const nginxUp = 1 -const nginxDown = 0 +const ( + nginxUp = 1 + nginxDown = 0 +) func newGlobalMetric(namespace string, metricName string, docString string, constLabels map[string]string) *prometheus.Desc { return prometheus.NewDesc(namespace+"_"+metricName, docString, nil, constLabels)