From a0a18aec259c3948a4cb8d435f4198b1c30af948 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Fri, 5 Jul 2024 18:25:30 +0800 Subject: [PATCH] test Signed-off-by: Jack Yu --- pkg/controller/usbdevice/usbdevice_controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/controller/usbdevice/usbdevice_controller.go b/pkg/controller/usbdevice/usbdevice_controller.go index 0e5fe4c..174f28b 100644 --- a/pkg/controller/usbdevice/usbdevice_controller.go +++ b/pkg/controller/usbdevice/usbdevice_controller.go @@ -80,9 +80,10 @@ func (h *DevHandler) WatchUSBDevices(ctx context.Context) error { } defer watcher.Close() - if err := filepath.Walk("/dev/bus/usb", func(path string, info fs.FileInfo, err error) error { + if err := filepath.WalkDir("/dev/bus/usb", func(path string, info fs.DirEntry, err error) error { fmt.Println("===========") fmt.Println(path) + fmt.Println(info.Name()) fmt.Println("===========") if err := watcher.Add(path); err != nil { return fmt.Errorf("failed to watch device %s parent directory: %s", path, err)