From a23a9f8598823dba851198b855fd236cd5be1aa4 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Thu, 15 Dec 2022 00:41:57 +0000 Subject: [PATCH] update docstrings in observer example --- examples/observer/main.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/observer/main.go b/examples/observer/main.go index a1f7c85..a9dae9a 100644 --- a/examples/observer/main.go +++ b/examples/observer/main.go @@ -20,8 +20,7 @@ func newObserver(vm *voicemeeter.Remote) *observer { return &observer{vm, make(chan string)} } -// OnUpdate satisfies the observer interface defined in publisher.go -// for each event type an action is triggered when the event occurs. +// Listen registers the observer channel and listens for udpates. func (o observer) Listen() { o.vm.Register(o.events) @@ -47,6 +46,7 @@ func init() { log.SetLevel(log.InfoLevel) } +// runObserver initiates a single observer and starts its Listen() function. func runObserver(vm *voicemeeter.Remote) { o := newObserver(vm) go o.Listen() @@ -67,6 +67,7 @@ func main() { } // vmConnect connects to Voicemeeter potato and logs into the API +// it also add ldirty to event updates. func vmConnect() (*voicemeeter.Remote, error) { vm, err := voicemeeter.NewRemote("basic", 0) if err != nil {