From 01a6923376d212fe4174b676f2667c817ee696f4 Mon Sep 17 00:00:00 2001 From: Blake Embrey Date: Thu, 23 Dec 2021 08:55:38 -0800 Subject: [PATCH] Rename fn to new --- pgconn.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pgconn.go b/pgconn.go index 6fde4e50..c437c119 100644 --- a/pgconn.go +++ b/pgconn.go @@ -239,7 +239,7 @@ func connect(ctx context.Context, config *Config, fallbackConfig *FallbackConfig return nil, &connectError{config: config, msg: "dial error", err: err} } - pgConn.contextWatcher = contextWatcher(netConn) + pgConn.contextWatcher = newContextWatcher(netConn) pgConn.contextWatcher.Watch(ctx) defer pgConn.contextWatcher.Unwatch() @@ -254,7 +254,7 @@ func connect(ctx context.Context, config *Config, fallbackConfig *FallbackConfig } pgConn.contextWatcher.Unwatch() - pgConn.contextWatcher = contextWatcher(tlsConn) + pgConn.contextWatcher = newContextWatcher(tlsConn) pgConn.contextWatcher.Watch(ctx) pgConn.conn = tlsConn @@ -348,7 +348,7 @@ func connect(ctx context.Context, config *Config, fallbackConfig *FallbackConfig } } -func contextWatcher(conn net.Conn) *ctxwatch.ContextWatcher { +func newContextWatcher(conn net.Conn) *ctxwatch.ContextWatcher { return ctxwatch.NewContextWatcher( func() { conn.SetDeadline(time.Date(1, 1, 1, 1, 1, 1, 1, time.UTC)) }, func() { conn.SetDeadline(time.Time{}) }, @@ -1718,7 +1718,7 @@ func Construct(hc *HijackedConn) (*PgConn, error) { cleanupDone: make(chan struct{}), } - pgConn.contextWatcher = contextWatcher(pgConn.conn) + pgConn.contextWatcher = newContextWatcher(pgConn.conn) return pgConn, nil }