From e5706271a0c114a2b185251694c0b28fb99d0d6f Mon Sep 17 00:00:00 2001 From: Luna Duclos Date: Fri, 9 Nov 2018 02:33:07 +0100 Subject: [PATCH] Publicly expose the driver so it can be wrapped (#166) --- proxy/dialers/postgres/hook.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proxy/dialers/postgres/hook.go b/proxy/dialers/postgres/hook.go index 967f678e8..8df85147f 100644 --- a/proxy/dialers/postgres/hook.go +++ b/proxy/dialers/postgres/hook.go @@ -32,10 +32,10 @@ import ( ) func init() { - sql.Register("cloudsqlpostgres", &drv{}) + sql.Register("cloudsqlpostgres", &Driver{}) } -type drv struct{} +type Driver struct{} type dialer struct{} @@ -56,6 +56,6 @@ func (d dialer) DialTimeout(ntw, addr string, timeout time.Duration) (net.Conn, return nil, fmt.Errorf("timeout is not currently supported for cloudsqlpostgres dialer") } -func (d *drv) Open(name string) (driver.Conn, error) { +func (d *Driver) Open(name string) (driver.Conn, error) { return pq.DialOpen(dialer{}, name) }