1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-04 13:27:14 +08:00

commands: Indent JSON-marshalled Response output

This commit is contained in:
Matt Bell
2014-11-08 20:19:27 -08:00
committed by Juan Batiz-Benet
parent c8345bb5c6
commit 20285ead82

View File

@ -43,9 +43,9 @@ const (
var marshallers = map[EncodingType]Marshaller{ var marshallers = map[EncodingType]Marshaller{
JSON: func(res Response) ([]byte, error) { JSON: func(res Response) ([]byte, error) {
if res.Error() != nil { if res.Error() != nil {
return json.Marshal(res.Error()) return json.MarshalIndent(res.Error(), "", " ")
} }
return json.Marshal(res.Output()) return json.MarshalIndent(res.Output(), "", " ")
}, },
XML: func(res Response) ([]byte, error) { XML: func(res Response) ([]byte, error) {
if res.Error() != nil { if res.Error() != nil {