15 lines
200 B
Go
15 lines
200 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"encoding/json"
|
|
)
|
|
|
|
func formatJson(v interface{}) []byte {
|
|
marshal, _ := json.Marshal(v)
|
|
var b bytes.Buffer
|
|
json.Indent(&b, marshal, "", " ")
|
|
|
|
return b.Bytes()
|
|
}
|