From e9f32edac5aff80e174e95cd952f3a3a6fcc611c Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Fri, 5 Jul 2024 10:54:08 +0200 Subject: [PATCH] e2e/cli-plugins: explicitly ignore fmt.Printxx errors To keep some linters happier, and my IDE to be less noisy. Signed-off-by: Sebastiaan van Stijn --- e2e/cli-plugins/plugins/presocket/main.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/e2e/cli-plugins/plugins/presocket/main.go b/e2e/cli-plugins/plugins/presocket/main.go index 6cdf87a424..d0ec79dcf4 100644 --- a/e2e/cli-plugins/plugins/presocket/main.go +++ b/e2e/cli-plugins/plugins/presocket/main.go @@ -39,18 +39,18 @@ func RootCmd(dockerCli command.Cli) *cobra.Command { RunE: func(cmd *cobra.Command, args []string) error { go func() { <-cmd.Context().Done() - fmt.Fprintln(dockerCli.Out(), "context cancelled") + _, _ = fmt.Fprintln(dockerCli.Out(), "context cancelled") os.Exit(2) }() signalCh := make(chan os.Signal, 10) signal.Notify(signalCh, syscall.SIGINT, syscall.SIGTERM) go func() { for range signalCh { - fmt.Fprintln(dockerCli.Out(), "received SIGINT") + _, _ = fmt.Fprintln(dockerCli.Out(), "received SIGINT") } }() <-time.After(3 * time.Second) - fmt.Fprintln(dockerCli.Err(), "exit after 3 seconds") + _, _ = fmt.Fprintln(dockerCli.Err(), "exit after 3 seconds") return nil }, }) @@ -64,18 +64,18 @@ func RootCmd(dockerCli command.Cli) *cobra.Command { RunE: func(cmd *cobra.Command, args []string) error { go func() { <-cmd.Context().Done() - fmt.Fprintln(dockerCli.Out(), "context cancelled") + _, _ = fmt.Fprintln(dockerCli.Out(), "context cancelled") os.Exit(2) }() signalCh := make(chan os.Signal, 10) signal.Notify(signalCh, syscall.SIGINT, syscall.SIGTERM) go func() { for range signalCh { - fmt.Fprintln(dockerCli.Out(), "received SIGINT") + _, _ = fmt.Fprintln(dockerCli.Out(), "received SIGINT") } }() <-time.After(3 * time.Second) - fmt.Fprintln(dockerCli.Err(), "exit after 3 seconds") + _, _ = fmt.Fprintln(dockerCli.Err(), "exit after 3 seconds") return nil }, }) @@ -91,11 +91,11 @@ func RootCmd(dockerCli command.Cli) *cobra.Command { signal.Notify(signalCh, syscall.SIGINT, syscall.SIGTERM) go func() { for range signalCh { - fmt.Fprintln(dockerCli.Out(), "received SIGINT") + _, _ = fmt.Fprintln(dockerCli.Out(), "received SIGINT") } }() <-time.After(3 * time.Second) - fmt.Fprintln(dockerCli.Err(), "exit after 3 seconds") + _, _ = fmt.Fprintln(dockerCli.Err(), "exit after 3 seconds") return nil }, }) @@ -113,7 +113,7 @@ func RootCmd(dockerCli command.Cli) *cobra.Command { select { case <-done: case <-time.After(2 * time.Second): - fmt.Fprint(dockerCli.Err(), "timeout after 2 seconds") + _, _ = fmt.Fprint(dockerCli.Err(), "timeout after 2 seconds") } return nil },