1
0
mirror of https://github.com/prometheus-community/windows_exporter.git synced 2025-08-08 12:02:09 +03:00

chore(deps): update dependency go to v1.24.1 (#1937)

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
Jan-Otto Kröpke
2025-03-14 10:05:40 +01:00
committed by GitHub
parent fce1e71cac
commit 221cfec732
8 changed files with 11 additions and 12 deletions

View File

@@ -92,5 +92,6 @@ jobs:
- name: golangci-lint - name: golangci-lint
uses: golangci/golangci-lint-action@4696ba8babb6127d732c3c6dde519db15edab9ea # v6 uses: golangci/golangci-lint-action@4696ba8babb6127d732c3c6dde519db15edab9ea # v6
with: with:
version: v1.60 # renovate: github=golangci/golangci-lint
version: v1.64.7
args: "--max-same-issues=0" args: "--max-same-issues=0"

View File

@@ -5,17 +5,14 @@ linters:
- depguard - depguard
- dupl - dupl
- err113 - err113
- execinquery
- exhaustive - exhaustive
- exhaustruct - exhaustruct
- exportloopref
- fatcontext - fatcontext
- funlen - funlen
- gocognit - gocognit
- goconst - goconst
- gocyclo - gocyclo
- godot - godot
- gomnd
- paralleltest - paralleltest
- lll - lll
- maintidx - maintidx

4
go.mod
View File

@@ -1,8 +1,6 @@
module github.com/prometheus-community/windows_exporter module github.com/prometheus-community/windows_exporter
go 1.23.0 go 1.24
toolchain go1.23.4
require ( require (
github.com/Microsoft/hcsshim v0.12.9 github.com/Microsoft/hcsshim v0.12.9

View File

@@ -43,7 +43,10 @@ func TestGetOwnerPIDOfTCPPort(t *testing.T) {
require.NoError(t, lister.Close()) require.NoError(t, lister.Close())
}) })
pid, err := iphlpapi.GetOwnerPIDOfTCPPort(windows.AF_INET, uint16(lister.Addr().(*net.TCPAddr).Port)) tcpAddr, ok := lister.Addr().(*net.TCPAddr)
require.True(t, ok)
pid, err := iphlpapi.GetOwnerPIDOfTCPPort(windows.AF_INET, uint16(tcpAddr.Port))
require.NoError(t, err) require.NoError(t, err)
require.EqualValues(t, os.Getpid(), pid) require.EqualValues(t, os.Getpid(), pid)
} }

View File

@@ -38,7 +38,7 @@ func Benchmark_MI_Query_Unmarshal(b *testing.B) {
query, err := mi.NewQuery("SELECT Name FROM Win32_Process WHERE Handle = 0 OR Handle = 4") query, err := mi.NewQuery("SELECT Name FROM Win32_Process WHERE Handle = 0 OR Handle = 4")
require.NoError(b, err) require.NoError(b, err)
for i := 0; i < b.N; i++ { for b.Loop() {
err := session.QueryUnmarshal(&processes, mi.OperationFlagsStandardRTTI, nil, mi.NamespaceRootCIMv2, mi.QueryDialectWQL, query) err := session.QueryUnmarshal(&processes, mi.OperationFlagsStandardRTTI, nil, mi.NamespaceRootCIMv2, mi.QueryDialectWQL, query)
require.NoError(b, err) require.NoError(b, err)
require.Equal(b, []win32Process{{Name: "System Idle Process"}, {Name: "System"}}, processes) require.Equal(b, []win32Process{{Name: "System Idle Process"}, {Name: "System"}}, processes)

View File

@@ -61,7 +61,7 @@ func BenchmarkTestCollector(b *testing.B) {
var data []processFull var data []processFull
for i := 0; i < b.N; i++ { for b.Loop() {
_ = performanceData.Collect(&data) _ = performanceData.Collect(&data)
} }

View File

@@ -5,7 +5,7 @@ import (
) )
func BenchmarkQueryPerformanceData(b *testing.B) { func BenchmarkQueryPerformanceData(b *testing.B) {
for n := 0; n < b.N; n++ { for b.Loop() {
_, _ = QueryPerformanceData("Global", "") _, _ = QueryPerformanceData("Global", "")
} }
} }

View File

@@ -57,7 +57,7 @@ func FuncBenchmarkCollector[C collector.Collector](b *testing.B, name string, co
} }
}() }()
for i := 0; i < b.N; i++ { for b.Loop() {
require.NoError(b, c.Collect(metrics)) require.NoError(b, c.Collect(metrics))
} }
} }