diff options
| author | Eugene Triguba <eugenetriguba@gmail.com> | 2024-02-07 21:44:22 -0500 |
|---|---|---|
| committer | Eugene Triguba <eugenetriguba@gmail.com> | 2024-02-07 21:44:22 -0500 |
| commit | b3595cd1f9793eaf8c1f80d1cfadbbebe328f0c4 (patch) | |
| tree | 853178ba7c913f6325629c17ad09b532c8a0f6fa | |
| parent | Use checkmate 0.3.0 (diff) | |
| download | cli-b3595cd1f9793eaf8c1f80d1cfadbbebe328f0c4.zip | |
Fix return value for console outputter output and error funcs
| -rw-r--r-- | internal/output/console.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/internal/output/console.go b/internal/output/console.go index 50534dd..7f04b28 100644 --- a/internal/output/console.go +++ b/internal/output/console.go @@ -18,12 +18,18 @@ func NewConsoleOutputter() ConsoleOutputter { func (c ConsoleOutputter) Output(message string) error { _, err := fmt.Fprintln(c.stdout, message) - return fmt.Errorf("unable to print message %s: %w", message, err) + if err != nil { + return fmt.Errorf("unable to print message %s: %w", message, err) + } + return nil } func (c ConsoleOutputter) Error(message string) error { _, err := fmt.Fprintln(c.stderr, message) - return fmt.Errorf("unable to print message %s: %w", message, err) + if err != nil { + return fmt.Errorf("unable to print message %s: %w", message, err) + } + return nil } func (c ConsoleOutputter) Table(headers []string, rows [][]string) error { |