bbgo_origin/pkg/util/json.go

16 lines
216 B
Go
Raw Permalink Normal View History

2022-05-17 10:23:09 +00:00
package util
import (
"encoding/json"
"io/ioutil"
)
func WriteJsonFile(p string, obj interface{}) error {
out, err := json.Marshal(obj)
2022-05-17 10:23:09 +00:00
if err != nil {
return err
}
return ioutil.WriteFile(p, out, 0644)
}