MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / MakeSyncBufferFromReader

Function MakeSyncBufferFromReader

pkg/util/syncbuf/syncbuf.go:25–29  ·  view source on GitHub ↗

spawns a goroutine to copy the reader to the buffer

(r io.Reader)

Source from the content-addressed store, hash-verified

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

Callers 2

MakeStdoutSyncBufferFunction · 0.92
MakeStderrSyncBufferFunction · 0.92

Calls 2

MakeSyncBufferFunction · 0.85
CopyMethod · 0.80

Tested by

no test coverage detected