Skip to content

Commit

Permalink
docs: add note about leaked goroutine (#42)
Browse files Browse the repository at this point in the history
Fixes #39.
  • Loading branch information
enocom authored Aug 16, 2021
1 parent 7441b71 commit f2de1e0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dial.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ var (
dErr error
)

// Dial returns a net.Conn connected to the specified Cloud SQL instance. The instance argument must be the
// instance's connection name, which is in the format "project-name:region:instance-name".
// Dial returns a net.Conn connected to the specified Cloud SQL instance. The
// instance argument must be the instance's connection name, which is in the
// format "project-name:region:instance-name". Dial is a convenience wrapper
// that instantiates a Dialer and dials the specified instance. The dialer's
// goroutine that keeps an instance's connection data fresh is leaked. Callers
// who are concerned about performance should instantiate a dialer on their own
// and close it when finished.
func Dial(ctx context.Context, instance string) (net.Conn, error) {
d, err := getDefaultDialer()
if err != nil {
Expand Down

0 comments on commit f2de1e0

Please sign in to comment.