8 // SyncBuffer is a buffer that the test and the client use at once.
9 type SyncBuffer struct {
14 func (b *SyncBuffer) Write(p []byte) (int, error) {
16 defer b.mutex.Unlock()
18 return b.buffer.Write(p)
21 func (b *SyncBuffer) String() string {
23 defer b.mutex.Unlock()
25 return b.buffer.String()