Skip to content

Commit 94c15f6

Browse files
committed
fix failed tests
1 parent 4079f4a commit 94c15f6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sqlite3.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2290,9 +2290,12 @@ type SQLiteConnector struct {
22902290
}
22912291

22922292
// Connect implements driver.Connector.
2293+
// If the provided context is already cancelled, returns its error immediately.
22932294
func (c *SQLiteConnector) Connect(ctx context.Context) (driver.Conn, error) {
2294-
// Context is ignored for now, as SQLiteDriver.Open does not use it.
2295-
return c.DriverInstance.Open(c.DSN)
2295+
if err := ctx.Err(); err != nil {
2296+
return nil, err
2297+
}
2298+
return c.DriverInstance.Open(c.DSN)
22962299
}
22972300

22982301
// Driver returns the underlying driver.

0 commit comments

Comments
 (0)