package manager import ( "context" "fmt" "time" "git.godopu.net/lab/etri-smartfarm-poc-controller-serial/puserial" "github.com/rjeczalik/notify" ) func Run() { fmt.Println("Hello world") ctx, _ := context.WithTimeout(context.Background(), time.Second*10) ch_discover := make(chan notify.EventInfo) go puserial.WatchNewDevice(ctx, ch_discover) for { e, ok := <-ch_discover if !ok { fmt.Println("byebye~!") return } fmt.Println(e) } }