func (rwcam *ReadWriteCloseAddresserMock) Write(p []byte) (n int, err error) {
	rwcam.writeCnt++
	n = 0
	err = rwcam.writeErr
	if rwcam.writeErr == nil {
		rwcam.writeOut = append(rwcam.writeOut, p...)
	}
	if rwcam.writeWaitChan != nil {
		rwcam.writeWaitChan <- p
	}
	return
}
Write is a mock
package net
import (
	"net"
	"time"
)
type ReadWriteCloseAddresserMock struct {
	readIn   []byte
	readErr  error
	readCnt  int
	readChan chan struct{}
	writeWaitChan chan []byte
	writeErr error
	writeOut []byte
	writeCnt int
	closeRes error
	closeCnt int
	remoteAddrRes net.Addr
	remoteAddrCnt int
}
func NewReadWriteCloseAddresserMock() *ReadWriteCloseAddresserMock {
	return &ReadWriteCloseAddresserMock{
		readChan: make(chan struct{}, 1),
	}
}
func (rwcam *ReadWriteCloseAddresserMock) SetReadResult(p []byte, err error) {
	rwcam.readIn = make([]byte, len(p))
	copy(rwcam.readIn, p)
	rwcam.readErr = err
	rwcam.readChan <- struct{}{}
}
func (rwcam *ReadWriteCloseAddresserMock) ReadCount() int {
	return rwcam.readCnt
}
func (rwcam *ReadWriteCloseAddresserMock) SetReadDeadline(t time.Time) error {
	return nil
}
func (rwcam *ReadWriteCloseAddresserMock) SetWriteDeadline(t time.Time) error {
	return nil
}
func (rwcam *ReadWriteCloseAddresserMock) Read(p []byte) (n int, err error) {
	rwcam.readCnt++
	<-rwcam.readChan
	err = rwcam.readErr
	n = 0
	if rwcam.readErr == nil {
		n = copy(p, rwcam.readIn)
	}
	return
}
func (rwcam *ReadWriteCloseAddresserMock) SetWriteResult(err error) {
	rwcam.writeErr = err
}
func (rwcam *ReadWriteCloseAddresserMock) WriteOut() (p []byte) {
	p = append(p, rwcam.writeOut...)
	return
}
func (rwcam *ReadWriteCloseAddresserMock) WriteCount() int {
	return rwcam.writeCnt
}