spawns a goroutine to copy the reader to the buffer
(r io.Reader)
| 23 | |
| 24 | // spawns a goroutine to copy the reader to the buffer |
| 25 | func MakeSyncBufferFromReader(r io.Reader) *SyncBuffer { |
| 26 | rtn := MakeSyncBuffer() |
| 27 | go io.Copy(rtn, r) |
| 28 | return rtn |
| 29 | } |
| 30 | |
| 31 | func (s *SyncBuffer) Write(p []byte) (n int, err error) { |
| 32 | s.lock.Lock() |
no test coverage detected