monflo/common.go
2020-09-10 16:08:06 +08:00

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()
}