silent errcheck

This commit is contained in:
Denis Bilenko 2024-12-09 11:59:07 +01:00
parent f94b50db63
commit df67c28a05
3 changed files with 5 additions and 5 deletions

View File

@ -437,8 +437,8 @@ func NewGenerateDashboardCommand() *cobra.Command {
// Included for symmetry with the other generate commands, but we prefer the shorter flags. // 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.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().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-path")
cmd.Flags().MarkHidden("existing-dashboard-id") _ = cmd.Flags().MarkHidden("existing-dashboard-id")
// Output flags. // Output flags.
cmd.Flags().StringVarP(&d.resourceDir, "resource-dir", "d", "./resources", `directory to write the configuration to`) 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") cmd.MarkFlagsMutuallyExclusive("watch", "existing-id")
// Completion for the resource flag. // Completion for the resource flag.
cmd.RegisterFlagCompletionFunc("resource", dashboardResourceCompletion) _ = cmd.RegisterFlagCompletionFunc("resource", dashboardResourceCompletion)
cmd.RunE = d.RunE cmd.RunE = d.RunE
return cmd return cmd

View File

@ -73,7 +73,7 @@ func newSummaryCommand() *cobra.Command {
if err != nil { if err != nil {
return err return err
} }
cmd.OutOrStdout().Write(buf) _, _ = cmd.OutOrStdout().Write(buf)
default: default:
return fmt.Errorf("unknown output type %s", root.OutputType(cmd)) return fmt.Errorf("unknown output type %s", root.OutputType(cmd))
} }

View File

@ -69,6 +69,6 @@ func initProgressLoggerFlag(cmd *cobra.Command, logFlags *logFlags) *progressLog
if err := flags.MarkHidden("progress-format"); err != nil { if err := flags.MarkHidden("progress-format"); err != nil {
panic(err) panic(err)
} }
cmd.RegisterFlagCompletionFunc("progress-format", f.ProgressLogFormat.Complete) _ = cmd.RegisterFlagCompletionFunc("progress-format", f.ProgressLogFormat.Complete)
return &f return &f
} }