Skip to content

Commit

Permalink
missed a few things
Browse files Browse the repository at this point in the history
  • Loading branch information
tabgok committed Feb 14, 2024
1 parent fde064d commit 5456182
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
5 changes: 0 additions & 5 deletions contrib/database/sql/internal/dsn.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ import (
// ParseDSN parses various supported DSN types into a map of key/value pairs which can be used as valid tags.
func ParseDSN(driverName, dsn string) (meta map[string]string, err error) {
meta = make(map[string]string)
if driverName != "mysql" && driverName != "postgres" && driverName != "sqlserver" && strings.Contains(dsn, ":") {
// If the DSN is valid but the driverName is not supported, use the
// drivername from the DSN instead
driverName = dsn[:strings.Index(dsn, ":")]
}
switch driverName {
case "mysql":
meta, err = parseMySQLDSN(dsn)
Expand Down
3 changes: 1 addition & 2 deletions contrib/database/sql/propagation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,14 @@ func TestDBMPropagation(t *testing.T) {
Register("test", d, tc.opts...)
defer unregister("test")

var db *sql.DB
var err error

dsn := "dn"
if tc.dsn != "" {
dsn = tc.dsn
}

db, err = Open("test", dsn)
db, err := Open("test", dsn)

require.NoError(t, err)

Expand Down

0 comments on commit 5456182

Please sign in to comment.