You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ConnectContext() should close the db when PingContext() returns an error.
The Open() function does not test the validity of the actual connection....auth or host....but does create a routine to handle opening connection through the sql.Open()->sql.OpenDB() statement. When PingContext() return an error due to bad auth or host connectivity then the wrapped db with the open routine is returned along with the error. It is not obvious that the db returned from the ConnectContext should be closed when an error is returned.
The Connect() function is executing the db.Close() so why doesn't the ConnectContext()?
Solution should be just as Connect() in that the db.Close() is executed and nil returned for the db.
The text was updated successfully, but these errors were encountered:
ConnectContext() should close the db when PingContext() returns an error.
The Open() function does not test the validity of the actual connection....auth or host....but does create a routine to handle opening connection through the sql.Open()->sql.OpenDB() statement. When PingContext() return an error due to bad auth or host connectivity then the wrapped db with the open routine is returned along with the error. It is not obvious that the db returned from the ConnectContext should be closed when an error is returned.
The Connect() function is executing the db.Close() so why doesn't the ConnectContext()?
Solution should be just as Connect() in that the db.Close() is executed and nil returned for the db.
The text was updated successfully, but these errors were encountered: