From 9e51e095ade8ae73416199c7d0e198f4355f5e37 Mon Sep 17 00:00:00 2001 From: shirou Date: Mon, 2 Nov 2020 22:01:27 +0900 Subject: [PATCH] [cpu][windows] fix CPU struct name on windows. --- v3/cpu/cpu_windows.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/v3/cpu/cpu_windows.go b/v3/cpu/cpu_windows.go index 04b1a47..bf25ef5 100644 --- a/v3/cpu/cpu_windows.go +++ b/v3/cpu/cpu_windows.go @@ -17,7 +17,7 @@ var ( procGetNativeSystemInfo = common.Modkernel32.NewProc("GetNativeSystemInfo") ) -type win32Processor struct { +type win32_Processor struct { LoadPercentage *uint16 Family uint16 Manufacturer string @@ -104,7 +104,7 @@ func Info() ([]InfoStat, error) { func InfoWithContext(ctx context.Context) ([]InfoStat, error) { var ret []InfoStat - var dst []win32Processor + var dst []win32_Processor q := wmi.CreateQuery(&dst, "") if err := common.WMIQueryWithContext(ctx, q, &dst); err != nil { return ret, err @@ -242,7 +242,7 @@ func CountsWithContext(ctx context.Context, logical bool) (int, error) { } // physical cores https://github.com/giampaolo/psutil/blob/d01a9eaa35a8aadf6c519839e987a49d8be2d891/psutil/_psutil_windows.c#L499 // for the time being, try with unreliable and slow WMI call… - var dst []win32Processor + var dst []win32_Processor q := wmi.CreateQuery(&dst, "") if err := common.WMIQueryWithContext(ctx, q, &dst); err != nil { return 0, err