mirror of https://github.com/jackc/pgx.git
go fmt
parent
05f94f7107
commit
18e225b66d
6
conn.go
6
conn.go
|
@ -9,7 +9,7 @@ type conn struct {
|
|||
conn net.Conn
|
||||
}
|
||||
|
||||
func Connect(options map[string] string) (c *conn, err error) {
|
||||
func Connect(options map[string]string) (c *conn, err error) {
|
||||
c = new(conn)
|
||||
|
||||
var present bool
|
||||
|
@ -17,7 +17,9 @@ func Connect(options map[string] string) (c *conn, err error) {
|
|||
|
||||
if socket, present = options["socket"]; present {
|
||||
c.conn, err = net.Dial("unix", socket)
|
||||
if err != nil { return nil, err }
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
// conn, err := net.Dial("tcp", "localhost:5432")
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
)
|
||||
|
||||
func TestConnect(t *testing.T) {
|
||||
_, err := Connect(map[string] string { "socket": "/private/tmp/.s.PGSQL.5432" })
|
||||
_, err := Connect(map[string]string{"socket": "/private/tmp/.s.PGSQL.5432"})
|
||||
if err != nil {
|
||||
t.Fatal("Unable to establish connection")
|
||||
}
|
||||
|
|
|
@ -9,11 +9,11 @@ const (
|
|||
)
|
||||
|
||||
type startupMessage struct {
|
||||
options map[string] string
|
||||
options map[string]string
|
||||
}
|
||||
|
||||
func newStartupMessage() *startupMessage {
|
||||
return &startupMessage{map[string] string{}}
|
||||
return &startupMessage{map[string]string{}}
|
||||
}
|
||||
|
||||
func (self *startupMessage) Bytes() (buf []byte) {
|
||||
|
|
Loading…
Reference in New Issue