@cryptotaxi247 / kubo / commits / fb55f0988

Add comment about reading until channel closed

gammazero committed Mar 29, 2021 at 15:11 UTC fb55f09882c0b0dcf395645b56d34be3840aceba
1 file changed +3
core/coreapi/pin.go
+3
@@ -219,6 +219,9 @@ func (p *pinInfo) Err() error {
219 }
220
221 // pinLsAll is an internal function for returning a list of pins
222 +//
223 +// The caller must keep reading results until the channel is closed to prevent
224 +// leaking the goroutine that is fetching pins.
225 func (api *PinAPI) pinLsAll(ctx context.Context, typeStr string) <-chan coreiface.Pin {
226 out := make(chan coreiface.Pin, 1)
227