func (b *buffer) Close() error {
	b.rnum = 0
	b.wnum = 0
	b.wclosed = true
	b.rclosed = true
	return nil
}
Add a Close method to our buffer so that we satisfy io.ReadWriteCloser.
package gota
import (
	"bytes"
	"errors"
	"io"
	"net"
	_ "net/http/pprof"
	"testing"
	"time"
	log "github.com/Sirupsen/logrus"
)
func TestNewCCID(t *testing.T) {
	cc := NewCCID(1, 2)
	if cc.ClientID() != 1 {
		t.Errorf("Error client ID: %d", cc.ClientID())
	}
	if cc.ConnID() != 2 {
		t.Errorf("Error conn ID: %d", cc.ConnID())
	}
	cc = NewCCID(0xFFFFFFFF, 0xFFFFFFFE)
	if cc.ClientID() != 0xFFFFFFFF {
		t.Errorf("Error client ID: %d", cc.ClientID())
	}
	if cc.ConnID() != 0xFFFFFFFE {
		t.Errorf("Error conn ID: %d", cc.ConnID())
	}
}
type buffer struct {
	strings [][]byte
	rnum    int
	wnum    int
	wclosed bool
	rclosed bool
}
func (b *buffer) Read(p []byte) (n int, err error) {
	l := len(b.strings)
	if b.rnum < l {
		copy(p, b.strings[b.rnum])
		n = len(b.strings[b.rnum])
		err = nil
		b.rnum++
		return
	}
	n = 0
	err = io.EOF
	return
}
func (b *buffer) Write(p []byte) (n int, err error) {
	l := len(b.strings)
	if b.wnum < l {
		if bytes.Compare(p, b.strings[b.wnum]) == 0 {
			log.Infof("Received test string: \"%s\"", b.strings[b.wnum])
			n = len(b.strings[b.wnum])
			err = nil
			b.wnum++
			return
		} else {
			n = 0
			err = errors.New("Mismatch!")
			return
		}
	}
	n = 0
	err = nil
	return
}