From 214715746aaf5e57485889f6c31def3c15f50798 Mon Sep 17 00:00:00 2001 From: lash Date: Thu, 5 Dec 2024 15:17:36 +0000 Subject: [PATCH] Add db type set option --- cmd/main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/main.go b/cmd/main.go index 242c112..8faa4c3 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -21,11 +21,15 @@ func init() { func main() { config.LoadConfig() + var database string var dbDir string + + flag.StringVar(&database, "db", "gdbm", "database to be used") flag.StringVar(&dbDir, "dbdir", ".state", "database dir to read from") flag.Parse() ctx := context.Background() + ctx = context.WithValue(ctx, "Database", database) // db := mem.NewMemDb() // err := db.Connect(ctx, "") // if err != nil {