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)