From 0121fd64710367f10ac2c1bf186747f956d1822e Mon Sep 17 00:00:00 2001 From: Calle Pettersson Date: Thu, 4 Oct 2018 21:55:00 +0200 Subject: [PATCH] Lint-fix: Final golint, ignore capitalisation rules --- collector/cpu.go | 1 + collector/iis.go | 4 ++-- collector/vmware.go | 1 + gometalinter.config | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/collector/cpu.go b/collector/cpu.go index ddbbc176..4638ca60 100644 --- a/collector/cpu.go +++ b/collector/cpu.go @@ -22,6 +22,7 @@ type CPUCollector struct { DPCsTotal *prometheus.Desc } +// NewCPUCollector constructs a new CPUCollector func NewCPUCollector() (Collector, error) { const subsystem = "cpu" return &CPUCollector{ diff --git a/collector/iis.go b/collector/iis.go index c723775d..5a8ad337 100644 --- a/collector/iis.go +++ b/collector/iis.go @@ -980,7 +980,7 @@ type Win32_PerfRawData_W3SVC_WebServiceCache struct { URICacheMisses uint32 } -var ApplicationStates = map[uint32]string{ +var applicationStates = map[uint32]string{ 1: "Uninitialized", 2: "Initialized", 3: "Running", @@ -1261,7 +1261,7 @@ func (c *IISCollector) collect(ch chan<- prometheus.Metric) (*prometheus.Desc, e } // Guages - for key, label := range ApplicationStates { + for key, label := range applicationStates { isCurrentState := 0.0 if key == app.CurrentApplicationPoolState { isCurrentState = 1.0 diff --git a/collector/vmware.go b/collector/vmware.go index efef0e1d..f71854f1 100644 --- a/collector/vmware.go +++ b/collector/vmware.go @@ -38,6 +38,7 @@ type VmwareCollector struct { HostProcessorSpeedMHz *prometheus.Desc } +// NewVmwareCollector constructs a new VmwareCollector func NewVmwareCollector() (Collector, error) { const subsystem = "vmware" return &VmwareCollector{ diff --git a/gometalinter.config b/gometalinter.config index 0ee3ac29..af60b94f 100644 --- a/gometalinter.config +++ b/gometalinter.config @@ -6,6 +6,7 @@ ], "Exclude": [ "don't use underscores in Go names", - "exported type .+ should have comment or be unexported" + "exported type .+ should have comment or be unexported", + "should be" ] } \ No newline at end of file