minor changes to raw json output

Signed-off-by: Michael <michael.lindman@gmail.com>
This commit is contained in:
Michael 2021-08-06 02:56:04 +01:00
parent 20478e3c1f
commit b34986d594
1 changed files with 3 additions and 4 deletions

View File

@ -36,11 +36,11 @@ func run() error {
return nil
}
if cmd.raw {
json, err := json.MarshalIndent(&status, "", " ")
if err != nil {
encoder := json.NewEncoder(os.Stdout)
encoder.SetIndent("", " ")
if err := encoder.Encode(status); err != nil {
return err
}
fmt.Printf("%s\n", string(json))
return nil
}
name := status.Description.Text
@ -63,6 +63,5 @@ func run() error {
return err
}
fmt.Printf("Ping: %+v\n", ping)
return nil
}
}