Skip to content

Commit 1f508e7

Browse files
committed
ref(pkg): handle/return Fprint errs
Signed-off-by: Vaughn Dice <[email protected]>
1 parent a376d71 commit 1f508e7

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

pkg/cmd/get.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ var getCmd = &cobra.Command{
3232
return err
3333
}
3434

35-
printApps(os.Stdout, app)
36-
return nil
35+
return printApps(os.Stdout, app)
3736
},
3837
}
3938

pkg/cmd/list.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ var listCmd = &cobra.Command{
1717
return err
1818
}
1919

20-
printApps(os.Stdout, appsResp.Items...)
21-
22-
return nil
20+
return printApps(os.Stdout, appsResp.Items...)
2321
},
2422
}
2523

pkg/cmd/output.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
spinv1alpha1 "github.com/spinkube/spin-operator/api/v1alpha1"
99
)
1010

11-
func printApps(w io.Writer, apps ...spinv1alpha1.SpinApp) {
11+
func printApps(w io.Writer, apps ...spinv1alpha1.SpinApp) error {
1212
table := uitable.New()
1313
table.MaxColWidth = 50
1414
table.AddRow("NAMESPACE", "NAME", "EXECUTOR", "READY")
@@ -17,5 +17,6 @@ func printApps(w io.Writer, apps ...spinv1alpha1.SpinApp) {
1717
table.AddRow(app.Namespace, app.Name, app.Spec.Executor, fmt.Sprintf("%d/%d", app.Status.ReadyReplicas, app.Spec.Replicas))
1818
}
1919

20-
_, _ = fmt.Fprintln(w, table)
20+
_, err := fmt.Fprintln(w, table)
21+
return err
2122
}

pkg/cmd/scaffold.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,9 @@ var scaffoldCmd = &cobra.Command{
198198

199199
}
200200

201-
_, _ = fmt.Fprint(os.Stdout, string(content))
201+
_, err = fmt.Fprint(os.Stdout, string(content))
202202

203-
return nil
203+
return err
204204
},
205205
}
206206

0 commit comments

Comments
 (0)