From b8508585a5c321d35f4bb460a93bb4b1503389bd Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 13 Jul 2022 10:33:07 +0300 Subject: [PATCH] [#1592] cmd: Ignore error when fetching a defined flag There is an error only if the flag is not defined, such errors should be caught during debugging. Signed-off-by: Evgenii Stratonikov --- cmd/neofs-adm/internal/modules/root.go | 4 ++-- cmd/neofs-lens/root.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/neofs-adm/internal/modules/root.go b/cmd/neofs-adm/internal/modules/root.go index 5c2cde674..eb7c814a6 100644 --- a/cmd/neofs-adm/internal/modules/root.go +++ b/cmd/neofs-adm/internal/modules/root.go @@ -50,8 +50,8 @@ func Execute() error { } func entryPoint(cmd *cobra.Command, args []string) error { - printVersion, err := cmd.Flags().GetBool("version") - if err == nil && printVersion { + printVersion, _ := cmd.Flags().GetBool("version") + if printVersion { cmd.Print(misc.BuildInfo("NeoFS Adm")) return nil } diff --git a/cmd/neofs-lens/root.go b/cmd/neofs-lens/root.go index 47784423e..0a0716e9d 100644 --- a/cmd/neofs-lens/root.go +++ b/cmd/neofs-lens/root.go @@ -19,8 +19,8 @@ var command = &cobra.Command{ } func entryPoint(cmd *cobra.Command, _ []string) error { - printVersion, err := cmd.Flags().GetBool("version") - if err == nil && printVersion { + printVersion, _ := cmd.Flags().GetBool("version") + if printVersion { cmd.Print(misc.BuildInfo("NeoFS Lens")) return nil