diff --git a/bar.go b/bar.go index 218988a..f696c6c 100644 --- a/bar.go +++ b/bar.go @@ -95,7 +95,7 @@ result := make(chan bool) select { case b.operateState <- func(s *bState) { result <- len(s.ewmaDecorators) != 0 }: - return b.newProxyReader(r, <-result) + return newProxyReader(r, b, <-result) case <-b.done: return nil } diff --git a/proxyreader.go b/proxyreader.go index 4bc1ad7..a79a03a 100644 --- a/proxyreader.go +++ b/proxyreader.go @@ -52,7 +52,7 @@ return n, err } -func (b *Bar) newProxyReader(r io.Reader, hasEwma bool) io.ReadCloser { +func newProxyReader(r io.Reader, b *Bar, hasEwma bool) io.ReadCloser { return toReadCloser(toReader(r, b, hasEwma)) }