[windows]: fix lint error about use-any

pull/1795/head
shirou 3 weeks ago
parent 22889d3f13
commit 8897eba676

@ -197,7 +197,7 @@ func ProcessorQueueLengthCounter() (*Win32PerformanceCounter, error) {
} }
// WMIQueryWithContext - wraps wmi.Query with a timed-out context to avoid hanging // WMIQueryWithContext - wraps wmi.Query with a timed-out context to avoid hanging
func WMIQueryWithContext(ctx context.Context, query string, dst interface{}, connectServerArgs ...interface{}) error { func WMIQueryWithContext(ctx context.Context, query string, dst any, connectServerArgs ...any) error {
if _, ok := ctx.Deadline(); !ok { if _, ok := ctx.Deadline(); !ok {
ctxTimeout, cancel := context.WithTimeout(ctx, Timeout) ctxTimeout, cancel := context.WithTimeout(ctx, Timeout)
defer cancel() defer cancel()

@ -328,7 +328,7 @@ func getTableUintptr(family uint32, buf []byte) uintptr {
return p return p
} }
func getTableInfo(filename string, table interface{}) (index, step, length int) { func getTableInfo(filename string, table any) (index, step, length int) {
switch filename { switch filename {
case kindTCP4.filename: case kindTCP4.filename:
index = int(unsafe.Sizeof(table.(pmibTCPTableOwnerPidAll).DwNumEntries)) index = int(unsafe.Sizeof(table.(pmibTCPTableOwnerPidAll).DwNumEntries))

Loading…
Cancel
Save