return JSON results in slice instead of table

Signed-off-by: Meredith Lancaster <malancas@github.com>
This commit is contained in:
Meredith Lancaster 2024-03-14 19:45:02 -06:00
parent 11eba5e25d
commit 338f9cf78c
2 changed files with 2 additions and 11 deletions

View file

@ -143,12 +143,7 @@ func runInspect(opts *Options) error {
jsonResults[i] = string(jsonBytes)
}
rows := make([][]string, 1)
rows[0] = jsonResults
if err = opts.Logger.PrintTableToStdOut(nil, rows); err != nil {
return fmt.Errorf("failed to print output as JSON: %w", err)
}
fmt.Fprintf(opts.Logger.IO.Out, "%v", jsonResults)
return nil
}

View file

@ -208,11 +208,7 @@ func runVerify(opts *Options) error {
jsonResults[i] = string(jsonBytes)
}
rows := make([][]string, 1)
rows[0] = jsonResults
if err := opts.Logger.PrintTableToStdOut(nil, rows); err != nil {
return fmt.Errorf("failed to print JSON output")
}
fmt.Fprintf(opts.Logger.IO.Out, "%v", jsonResults)
}
// All attestations passed verification and policy evaluation