From d05f21cb983f947b64affd478e7ee9c45a2566ba Mon Sep 17 00:00:00 2001 From: andig Date: Fri, 22 Dec 2023 12:03:10 +0100 Subject: [PATCH] chore: more docs --- util/monitor.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/monitor.go b/util/monitor.go index 7f056a266..5be4ac26b 100644 --- a/util/monitor.go +++ b/util/monitor.go @@ -7,6 +7,7 @@ import ( "github.com/evcc-io/evcc/api" ) +// Monitor monitors values for regular updates type Monitor[T any] struct { val T mu sync.RWMutex @@ -16,6 +17,7 @@ type Monitor[T any] struct { timeout time.Duration } +// NewMonitor created a new monitor with given timeout func NewMonitor[T any](timeout time.Duration) *Monitor[T] { return &Monitor[T]{ done: make(chan struct{}),