diff --git a/config/database.go b/config/database.go index d5f4764be1..e07fd7fe37 100644 --- a/config/database.go +++ b/config/database.go @@ -139,7 +139,7 @@ func parseDSN(dsn string) (string, string, error) { // Treat the DSN as the URL that it is. s := strings.SplitN(dsn, "://", 2) if len(s) != 2 { - errors.New("failed to parse DSN as URL") + return "", "", errors.New("failed to parse DSN as URL") } scheme := s[0] diff --git a/config/database_test.go b/config/database_test.go index 3ff1dddc32..3c61c6f8c1 100644 --- a/config/database_test.go +++ b/config/database_test.go @@ -155,6 +155,9 @@ func TestDatabaseStoreNew(t *testing.T) { t.Run("invalid url", func(t *testing.T) { _, err := config.NewDatabaseStore("") require.Error(t, err) + + _, err = config.NewDatabaseStore("mysql") + require.Error(t, err) }) t.Run("unsupported scheme", func(t *testing.T) {