diff --git a/internal/collector/license/license.go b/internal/collector/license/license.go index 6cf7485fb..e40caa519 100644 --- a/internal/collector/license/license.go +++ b/internal/collector/license/license.go @@ -27,6 +27,7 @@ import ( const Name = "license" +//nolint:gochecknoglobals var labelMap = map[slc.SL_GENUINE_STATE]string{ slc.SL_GEN_STATE_IS_GENUINE: "genuine", slc.SL_GEN_STATE_INVALID_LICENSE: "invalid_license", diff --git a/internal/collector/net/net.go b/internal/collector/net/net.go index 2738b20e6..193639724 100644 --- a/internal/collector/net/net.go +++ b/internal/collector/net/net.go @@ -393,6 +393,8 @@ func (c *Collector) collect(ch chan<- prometheus.Metric) error { return nil } +//nolint:gochecknoglobals + var addressFamily = map[uint16]string{ windows.AF_INET: "ipv4", windows.AF_INET6: "ipv6", diff --git a/internal/collector/scheduled_task/scheduled_task.go b/internal/collector/scheduled_task/scheduled_task.go index a0c1dd8f3..382b5d437 100644 --- a/internal/collector/scheduled_task/scheduled_task.go +++ b/internal/collector/scheduled_task/scheduled_task.go @@ -82,6 +82,7 @@ const ( SCHED_S_TASK_HAS_NOT_RUN TaskResult = 0x00041303 ) +//nolint:gochecknoglobals var taskStates = []string{"disabled", "queued", "ready", "running", "unknown"} type scheduledTask struct { diff --git a/internal/mi/application.go b/internal/mi/application.go index 16b2f4c35..e66e39d9e 100644 --- a/internal/mi/application.go +++ b/internal/mi/application.go @@ -44,6 +44,7 @@ var ( DestinationOptionsUILocale = UTF16PtrFromString[*uint16]("__MI_DESTINATIONOPTIONS_UI_LOCALE") ) +//nolint:gochecknoglobals var ( modMi = windows.NewLazySystemDLL("mi.dll") diff --git a/internal/mi/operation.go b/internal/mi/operation.go index 767bf8695..35b3a622b 100644 --- a/internal/mi/operation.go +++ b/internal/mi/operation.go @@ -29,6 +29,8 @@ import ( // OperationOptionsTimeout is the key for the timeout option. // // https://github.com/microsoft/win32metadata/blob/527806d20d83d3abd43d16cd3fa8795d8deba343/generation/WinSDK/RecompiledIdlHeaders/um/mi.h#L9240 +// +//nolint:gochecknoglobals var OperationOptionsTimeout = UTF16PtrFromString[*uint16]("__MI_OPERATIONOPTIONS_TIMEOUT") // OperationFlags represents the flags for an operation. diff --git a/internal/perfdata/pdh.go b/internal/perfdata/pdh.go index 22625fd68..d07b3a210 100644 --- a/internal/perfdata/pdh.go +++ b/internal/perfdata/pdh.go @@ -144,6 +144,7 @@ const ( PdhQueryPerfDataTimeout uint32 = 0xC0000BFE ) +//nolint:gochecknoglobals var PDHErrors = map[uint32]string{ PdhCstatusValidData: "PDH_CSTATUS_VALID_DATA", PdhCstatusNewData: "PDH_CSTATUS_NEW_DATA", diff --git a/pkg/collector/config.go b/pkg/collector/config.go index 0d49f0ece..533947e38 100644 --- a/pkg/collector/config.go +++ b/pkg/collector/config.go @@ -119,6 +119,7 @@ type Config struct { // ConfigDefaults Is an interface to be used by the external libraries. It holds all ConfigDefaults form all collectors // +//nolint:gochecknoglobals //goland:noinspection GoUnusedGlobalVariable var ConfigDefaults = Config{ AD: ad.ConfigDefaults, diff --git a/pkg/collector/map.go b/pkg/collector/map.go index 68472df5c..979a86281 100644 --- a/pkg/collector/map.go +++ b/pkg/collector/map.go @@ -76,6 +76,7 @@ func NewBuilderWithFlags[C Collector](fn BuilderWithFlags[C]) BuilderWithFlags[C } } +//nolint:gochecknoglobals var BuildersWithFlags = map[string]BuilderWithFlags[Collector]{ ad.Name: NewBuilderWithFlags(ad.NewWithFlags), adcs.Name: NewBuilderWithFlags(adcs.NewWithFlags),