Skip to content

Commit

Permalink
prettify output
Browse files Browse the repository at this point in the history
Signed-off-by: Billy Zha <[email protected]>
  • Loading branch information
qweeah committed Dec 14, 2023
1 parent 3d71569 commit 46759a3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/oras/internal/option/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ limitations under the License.
package option

import (
"bytes"
"encoding/json"
"io"
"text/template"
Expand Down Expand Up @@ -51,7 +52,9 @@ func (opts *Format) WriteTo(w io.Writer, data interface{}) error {
if err != nil {
return err
}
_, err = w.Write(b)
buf := bytes.NewBuffer(nil)
_ = json.Indent(buf, b, "", " ")
_, err = w.Write(buf.Bytes())
if err != nil {
return err
}
Expand Down

0 comments on commit 46759a3

Please sign in to comment.