From fb55f09882c0b0dcf395645b56d34be3840aceba Mon Sep 17 00:00:00 2001 From: gammazero Date: Mon, 29 Mar 2021 15:11:38 -0700 Subject: [PATCH] Add comment about reading until channel closed --- core/coreapi/pin.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/coreapi/pin.go b/core/coreapi/pin.go index 160db2c04..b5db63d35 100644 --- a/core/coreapi/pin.go +++ b/core/coreapi/pin.go @@ -219,6 +219,9 @@ func (p *pinInfo) Err() error { } // pinLsAll is an internal function for returning a list of pins +// +// The caller must keep reading results until the channel is closed to prevent +// leaking the goroutine that is fetching pins. func (api *PinAPI) pinLsAll(ctx context.Context, typeStr string) <-chan coreiface.Pin { out := make(chan coreiface.Pin, 1)