diff --git a/conn.go b/conn.go index 1eae8f28..48d6b6f6 100644 --- a/conn.go +++ b/conn.go @@ -34,7 +34,7 @@ func Connect(options map[string]string) (c *conn, err error) { msg := newStartupMessage() msg.options["user"] = "jack" - c.conn.Write(msg.Bytes()) + c.txStartupMessage(msg) var response interface{} response, err = c.rxMsg() @@ -143,3 +143,8 @@ func (c *conn) rxReadyForQuery(buf []byte) (msg *readyForQuery) { msg.txStatus = buf[0] return } + +func (c *conn) txStartupMessage(msg *startupMessage) (err error) { + _, err = c.conn.Write(msg.Bytes()) + return +}