diff --git a/internal/auth/password/repository_password.go b/internal/auth/password/repository_password.go index 1ebbc18a4..f335afec6 100644 --- a/internal/auth/password/repository_password.go +++ b/internal/auth/password/repository_password.go @@ -215,7 +215,6 @@ func (r *Repository) authenticate(ctx context.Context, scopeId, authMethodId, lo var accts []authAccount rows, err := r.reader.Query(ctx, authenticateQuery, []interface{}{sql.Named("auth_method_id", authMethodId), sql.Named("login_name", loginName)}) - if err != nil { return nil, errors.Wrap(ctx, err, op) } diff --git a/internal/db/db.go b/internal/db/db.go index 2f5ff3d6d..e9aeaeba1 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -29,6 +29,7 @@ func (db DbType) String() string { "postgres", }[db] } + func StringToDbType(dialect string) (DbType, error) { switch dialect { case "postgres": @@ -80,7 +81,8 @@ func Open(dbType DbType, connectionUrl string, opt ...Option) (*DB, error) { switch dbType { case Postgres: dialect = postgres.New(postgres.Config{ - DSN: connectionUrl}, + DSN: connectionUrl, + }, ) default: return nil, fmt.Errorf("unable to open %s database type", dbType) diff --git a/internal/db/schema/edition.go b/internal/db/schema/edition.go index 1aa0899ef..9b17ad722 100644 --- a/internal/db/schema/edition.go +++ b/internal/db/schema/edition.go @@ -17,7 +17,7 @@ const ( ) var supportedDialects = map[Dialect]struct{}{ - Postgres: struct{}{}, + Postgres: {}, } // type dialects map[Dialect]edition.Editions diff --git a/internal/db/schema/internal/provider/provider_test.go b/internal/db/schema/internal/provider/provider_test.go index a55b02a67..cd4ad1c52 100644 --- a/internal/db/schema/internal/provider/provider_test.go +++ b/internal/db/schema/internal/provider/provider_test.go @@ -155,5 +155,4 @@ func TestProvider(t *testing.T) { assert.Nil(t, p.Statements(), tt.name) }) } - } diff --git a/internal/oplog/oplog_test.go b/internal/oplog/oplog_test.go index c7fc4c8a1..8a87d5eee 100644 --- a/internal/oplog/oplog_test.go +++ b/internal/oplog/oplog_test.go @@ -41,7 +41,8 @@ func testOpen(dbType string, connectionUrl string) (*gorm.DB, error) { switch dbType { case "postgres": dialect = postgres.New(postgres.Config{ - DSN: connectionUrl}, + DSN: connectionUrl, + }, ) default: return nil, fmt.Errorf("unable to open %s database type", dbType)