refactor sqlite repository
This commit is contained in:
@@ -20,7 +20,7 @@ type SqliteRepository struct {
|
||||
ctx context.Context
|
||||
}
|
||||
|
||||
func NewSqliteRepository(dbPath string, ctx context.Context) (*SqliteRepository, error) {
|
||||
func NewSqliteRepository(ctx context.Context, dbPath string) (*SqliteRepository, error) {
|
||||
sqliteDb, err := sqlc.OpenSqliteDb(dbPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
func TestNewSqliteDB(t *testing.T) {
|
||||
dbPath := os.Getenv("TEST_DB")
|
||||
ctx := context.Background()
|
||||
sqliteDb, err := NewSqliteRepository(dbPath, ctx)
|
||||
sqliteDb, err := NewSqliteRepository(ctx, dbPath)
|
||||
assert.NoError(t, err)
|
||||
sqliteDb.Start()
|
||||
defer func(t *testing.T, sqliteDb *SqliteRepository) {
|
||||
|
||||
Reference in New Issue
Block a user