Skip to content

Commit

Permalink
fix pretty print int64 fields format
Browse files Browse the repository at this point in the history
  • Loading branch information
bearmini committed Apr 5, 2016
1 parent 5842f8a commit da82278
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions generators/cmd/predefined/pretty_print_json.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package cmd

import (
"bytes"
"encoding/json"
"fmt"
"os"
"strings"
)

func prettyPrintJSON(rawJSON string) error {
var obj interface{}

err := json.Unmarshal(bytes.NewBufferString(rawJSON).Bytes(), &obj)
d := json.NewDecoder(strings.NewReader(rawJSON))
d.UseNumber()
err := d.Decode(&obj)
if err != nil {
return err
}
Expand Down
6 changes: 4 additions & 2 deletions soracom/generated/cmd/pretty_print_json.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
package cmd

import (
"bytes"
"encoding/json"
"fmt"
"os"
"strings"
)

func prettyPrintJSON(rawJSON string) error {
var obj interface{}

err := json.Unmarshal(bytes.NewBufferString(rawJSON).Bytes(), &obj)
d := json.NewDecoder(strings.NewReader(rawJSON))
d.UseNumber()
err := d.Decode(&obj)
if err != nil {
return err
}
Expand Down

0 comments on commit da82278

Please sign in to comment.