replace TrimLeft with TrimPrefix

This commit is contained in:
Pranav Shridhar 2024-06-08 16:42:08 +05:30
parent b818224df9
commit e4da1db487
2 changed files with 2 additions and 2 deletions

View file

@ -135,7 +135,7 @@ func (s *SqliteBackend) initializeDB() (err error) {
return
}
dbPath := strings.TrimLeft(s.config.ConnectionString, "sqlite3://")
dbPath := strings.TrimPrefix(s.config.ConnectionString, "sqlite3://")
s.db, err = sql.Open("sqlite3", dbPath)
if err != nil {
s.logger.Error("unable to set db connection")

View file

@ -44,8 +44,8 @@ func prepareAndCleanupDB(t *testing.T) (dbURL string, db *sql.DB) {
}
cwd, _ := os.Getwd()
dbURL = "sqlite3://" + cwd + "/test.db"
dbPath := cwd + "/test.db"
dbURL = "sqlite3://" + dbPath
m, err := migrate.NewWithSourceInstance("iofs", migrations, dbURL)
if err != nil {