bbgo_origin/pkg/util/json.go
2022-05-17 18:23:09 +08:00

16 lines
232 B
Go

package util
import (
"encoding/json"
"io/ioutil"
)
func WriteJsonFile(p string, obj interface{}) error {
out, err := json.MarshalIndent(obj, "", " ")
if err != nil {
return err
}
return ioutil.WriteFile(p, out, 0644)
}