Skip to content

Commit 1cd7665

Browse files
committed
🧹 handle usb parsing case
1 parent 54ad848 commit 1cd7665

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

providers/os/resources/usb/parser_plist.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import (
77
"fmt"
88
"strconv"
99
"strings"
10+
11+
"go.mondoo.com/cnquery/v12/providers/os/resources/plist"
1012
)
1113

1214
type USBDevice struct {
@@ -32,6 +34,11 @@ type USBDevice struct {
3234
func ParseMacosIORegData(data any, devices *[]USBDevice) {
3335
// Process the data based on its type
3436
switch v := data.(type) {
37+
case plist.Data:
38+
// root object, we need to convert it to map[string]any
39+
obj := data.(plist.Data)
40+
// typecase so that we reach case map[string]any
41+
ParseMacosIORegData(map[string]any(obj), devices)
3542
case []any:
3643
// An array of entries
3744
for _, entry := range v {

0 commit comments

Comments
 (0)