Skip to content
Snippets Groups Projects
Unverified Commit 5fd6568d authored by Ahmet Alp Balkan's avatar Ahmet Alp Balkan
Browse files

json printing

parent e781e5c8
No related branches found
No related tags found
No related merge requests found
......@@ -18,12 +18,12 @@ package app
import (
"bytes"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"strconv"
"time"
"github.com/davecgh/go-spew/spew"
"github.com/go-openapi/runtime"
"github.com/sigstore/rekor/cmd/rekor-cli/app/format"
"github.com/sigstore/rekor/pkg/generated/client/entries"
......@@ -47,7 +47,11 @@ func (g *getCmdOutput) String() string {
dt := time.Unix(g.IntegratedTime, 0).UTC().Format(time.RFC3339)
s += fmt.Sprintf("IntegratedTime: %s\n", dt)
s += fmt.Sprintf("UUID: %s\n", g.UUID)
s += fmt.Sprintf("Body: %s\n", spew.Sdump(g.Body))
var b bytes.Buffer
e := json.NewEncoder(&b)
e.SetIndent("", " ")
e.Encode(g.Body)
s += fmt.Sprintf("Body: %s\n", b.Bytes())
return s
}
......
......@@ -7,7 +7,6 @@ require (
github.com/blang/semver v3.5.1+incompatible
github.com/cavaliercoder/badio v0.0.0-20160213150051-ce5280129e9e // indirect
github.com/cavaliercoder/go-rpm v0.0.0-20200122174316-8cb9fd9c31a8
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/ghodss/yaml v1.0.0
github.com/go-chi/chi v4.1.2+incompatible
github.com/go-openapi/errors v0.20.0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment