Skip to content

Driver does not implement driver.DriverContext interface #236

Open
@nvx

Description

@nvx

As per the docs at https://pkg.go.dev/database/sql/driver "Drivers should implement Connector and DriverContext interfaces."

At a quick glance you'd think this driver implements driver.DriverContext due to this method:

func (d *Driver) OpenConnector(dsn string) (*Connector, error) {

But on closer inspection the return type of this func is a *go-mssqldb.Connector not a driver.Connector interface meaning it does not actually implement the interface.

Changing the return type would fix this, but it would mean anyone relying on the concrete type being returned would need to be updated. Thankfully the failure mode for this is a compilation failure so should be fairly easy to detect and fix either by adding an appropriate cast or NewConnector could be used instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions