func NewReader(r io.Reader) *Reader {
	return &Reader{
		nil,
		bufio.NewReader(r),
	}
}
NewReader creates an irc.Reader from an io.Reader. Note that once a reader is
passed into this function, you should no longer use it as it is being used
inside a bufio.Reader so you cannot rely on only the amount of data for a
Message being read when you call ReadMessage.
package irc
import (
	"bufio"
	"fmt"
	"io"
)
type Conn struct {
	*Reader
	*Writer
}
func NewConn(rw io.ReadWriter) *Conn {
	return &Conn{
		NewReader(rw),
		NewWriter(rw),
	}
}
type Writer struct {
	DebugCallback func(line string)
	writer        io.Writer
	writeCallback func(w *Writer, line string) error
}
func defaultWriteCallback(w *Writer, line string) error {
	_, err := w.writer.Write([]byte(line + "\r\n"))
	return err
}
func NewWriter(w io.Writer) *Writer {
	return &Writer{nil, w, defaultWriteCallback}
}
func (w *Writer) Write(line string) error {
	if w.DebugCallback != nil {
		w.DebugCallback(line)
	}
	return w.writeCallback(w, line)
}
func (w *Writer) Writef(format string, args ...interface{}) error {
	return w.Write(fmt.Sprintf(format, args...))
}
func (w *Writer) WriteMessage(m *Message) error {
	return w.Write(m.String())
}
type Reader struct {
	DebugCallback func(string)
	reader *bufio.Reader
}