From 80f8a8fd3abd0cf9a605c4002cbaced6f2fd9b8c Mon Sep 17 00:00:00 2001 From: Alexander Chuprov Date: Tue, 12 Nov 2024 11:09:27 +0300 Subject: [PATCH] [#1396] cli/playground: Refactor Signed-off-by: Alexander Chuprov --- cmd/frostfs-cli/modules/container/policy_playground.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmd/frostfs-cli/modules/container/policy_playground.go b/cmd/frostfs-cli/modules/container/policy_playground.go index 6885d35f2..40bd4110b 100644 --- a/cmd/frostfs-cli/modules/container/policy_playground.go +++ b/cmd/frostfs-cli/modules/container/policy_playground.go @@ -221,7 +221,7 @@ func (repl *policyPlaygroundREPL) run() error { exit = true continue } - return fmt.Errorf("reading line: %v", err) + return fmt.Errorf("reading line: %w", err) } exit = false @@ -230,8 +230,7 @@ func (repl *policyPlaygroundREPL) run() error { continue } cmd := parts[0] - handler, exists := cmdHandlers[cmd] - if exists { + if handler, exists := cmdHandlers[cmd]; exists { if err := handler(parts[1:]); err != nil { fmt.Printf("error: %v\n", err) }