Refactor to use conndata as menustorageservice conn arg

This commit is contained in:
lash
2025-01-04 20:36:18 +00:00
parent f61e65f4fe
commit 450dfa02cc
12 changed files with 98 additions and 125 deletions

View File

@@ -44,10 +44,15 @@ func TestEngine(sessionId string) (engine.Engine, func(), chan bool) {
fmt.Fprintf(os.Stderr, "connstr err: %v", err)
os.Exit(1)
}
conn, err := storage.ToConnData(connStr)
if err != nil {
fmt.Fprintf(os.Stderr, "connstr parse err: %v", err)
os.Exit(1)
}
resourceDir := scriptDir
menuStorageService := storage.NewMenuStorageService(resourceDir)
err = menuStorageService.SetConn(connStr)
menuStorageService.WithConn(conn)
if err != nil {
fmt.Fprintf(os.Stderr, "conn error: %v", err)
os.Exit(1)