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
Allow to change (or disable) the default driver name for registration
A link variable now allows to change or disable the name of the driver
that is automatically registered with database/sql:
Change driver name:
go build "-ldflags=-X github.com/go-sql-driver/mysql.driverName=custom"
Disable driver registration (set driverName to empty string):
go build "-ldflags=-X github.com/go-sql-driver/mysql.driverName="
In the same way, a variable overridable at link time is also provided to
override the driver name used in the test suite. This allows to run our
test suite on another driver.
go test "-ldflags=-X github.com/go-sql-driver/mysql.driverNameTest=custom"
driverName is propagated to driverNameTest unless driverNameTest is
explicitely defined.
0 commit comments