Update redskyctl/internal/commands/generate/trial.go
@@ -130,13 +130,14 @@ func (o *TrialOptions) generate() error {
t.Annotations = nil
// If requested, convert the trial into a job
- var obj interface{} = t
- if o.Job != "" {
- obj, err = newJob(t, o.Job, o.JobTrialNumber)
+if o.Job == "" {
+ return o.Printer.PrintObj(t, o.Out)
+}
+
+obj, err := newJob(t, o.Job, o.JobTrialNumber)
if err != nil {
return err
}
- }
return o.Printer.PrintObj(obj, o.Out)
}
