From 83a10efcd9b42b64b0210ad280eaabd4d232af67 Mon Sep 17 00:00:00 2001 From: alfred-mk Date: Thu, 20 Feb 2025 15:10:18 +0300 Subject: [PATCH] remove the sessionId from the ctx to prevent double sessionId key (.) --- cmd/main.go | 17 ++++++++--------- devtools/admin/main.go | 1 - 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index 564649a..a18bfab 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -62,7 +62,6 @@ func main() { } ctx := context.Background() - ctx = context.WithValue(ctx, "SessionId", sessionId) ln, err := lang.LanguageFromCode(config.Language()) if err != nil { @@ -74,12 +73,12 @@ func main() { pfp := path.Join(scriptDir, "pp.csv") cfg := engine.Config{ - Root: "root", - SessionId: sessionId, - OutputSize: uint32(size), - FlagCount: uint32(128), - MenuSeparator: menuSeparator, - EngineDebug: engineDebug, + Root: "root", + SessionId: sessionId, + OutputSize: uint32(size), + FlagCount: uint32(128), + MenuSeparator: menuSeparator, + EngineDebug: engineDebug, ResetOnEmptyInput: true, } @@ -128,8 +127,8 @@ func main() { accountService := services.New(ctx, menuStorageService) _, err = lhs.GetHandler(accountService) if err != nil { - fmt.Fprintf(os.Stderr, "get accounts service handler: %v\n", err) - os.Exit(1) + fmt.Fprintf(os.Stderr, "get accounts service handler: %v\n", err) + os.Exit(1) } en := lhs.GetEngine(cfg, rs, pe) diff --git a/devtools/admin/main.go b/devtools/admin/main.go index 3ae40b6..c3ce57f 100644 --- a/devtools/admin/main.go +++ b/devtools/admin/main.go @@ -42,7 +42,6 @@ func main() { } ctx := context.Background() - ctx = context.WithValue(ctx, "SessionId", sessionId) pfp := path.Join(scriptDir, "pp.csv") flagParser, err := application.NewFlagManager(pfp)