From df67c28a052b2e8bbe37f09a847a27dacd8e9ea7 Mon Sep 17 00:00:00 2001 From: Denis Bilenko Date: Mon, 9 Dec 2024 11:59:07 +0100 Subject: [PATCH] silent errcheck --- cmd/bundle/generate/dashboard.go | 6 +++--- cmd/bundle/summary.go | 2 +- cmd/root/progress_logger.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/bundle/generate/dashboard.go b/cmd/bundle/generate/dashboard.go index 4a538a293..27b4dc9d0 100644 --- a/cmd/bundle/generate/dashboard.go +++ b/cmd/bundle/generate/dashboard.go @@ -437,8 +437,8 @@ func NewGenerateDashboardCommand() *cobra.Command { // Included for symmetry with the other generate commands, but we prefer the shorter flags. cmd.Flags().StringVar(&d.existingPath, "existing-dashboard-path", "", `workspace path of the dashboard to generate configuration for`) cmd.Flags().StringVar(&d.existingID, "existing-dashboard-id", "", `ID of the dashboard to generate configuration for`) - cmd.Flags().MarkHidden("existing-dashboard-path") - cmd.Flags().MarkHidden("existing-dashboard-id") + _ = cmd.Flags().MarkHidden("existing-dashboard-path") + _ = cmd.Flags().MarkHidden("existing-dashboard-id") // Output flags. cmd.Flags().StringVarP(&d.resourceDir, "resource-dir", "d", "./resources", `directory to write the configuration to`) @@ -460,7 +460,7 @@ func NewGenerateDashboardCommand() *cobra.Command { cmd.MarkFlagsMutuallyExclusive("watch", "existing-id") // Completion for the resource flag. - cmd.RegisterFlagCompletionFunc("resource", dashboardResourceCompletion) + _ = cmd.RegisterFlagCompletionFunc("resource", dashboardResourceCompletion) cmd.RunE = d.RunE return cmd diff --git a/cmd/bundle/summary.go b/cmd/bundle/summary.go index 8c34dd612..7c669c845 100644 --- a/cmd/bundle/summary.go +++ b/cmd/bundle/summary.go @@ -73,7 +73,7 @@ func newSummaryCommand() *cobra.Command { if err != nil { return err } - cmd.OutOrStdout().Write(buf) + _, _ = cmd.OutOrStdout().Write(buf) default: return fmt.Errorf("unknown output type %s", root.OutputType(cmd)) } diff --git a/cmd/root/progress_logger.go b/cmd/root/progress_logger.go index 4d30bf425..2a749425e 100644 --- a/cmd/root/progress_logger.go +++ b/cmd/root/progress_logger.go @@ -69,6 +69,6 @@ func initProgressLoggerFlag(cmd *cobra.Command, logFlags *logFlags) *progressLog if err := flags.MarkHidden("progress-format"); err != nil { panic(err) } - cmd.RegisterFlagCompletionFunc("progress-format", f.ProgressLogFormat.Complete) + _ = cmd.RegisterFlagCompletionFunc("progress-format", f.ProgressLogFormat.Complete) return &f }