aboutsummaryrefslogtreecommitdiffstats
path: root/share.go
diff options
context:
space:
mode:
Diffstat (limited to 'share.go')
-rw-r--r--share.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/share.go b/share.go
index b370e5a..dc99e70 100644
--- a/share.go
+++ b/share.go
@@ -42,6 +42,7 @@ func newSharedVal[T any]() sharedVal[T] {
// get makes a synchronous request and returns the stored value.
func (sv sharedVal[T]) get() T {
c := make(chan T)
+ defer close(c)
sv.request <- c
return <-c
}