mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-23 15:25:14 +00:00
16 lines
216 B
Go
16 lines
216 B
Go
package util
|
|
|
|
import (
|
|
"encoding/json"
|
|
"io/ioutil"
|
|
)
|
|
|
|
func WriteJsonFile(p string, obj interface{}) error {
|
|
out, err := json.Marshal(obj)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
return ioutil.WriteFile(p, out, 0644)
|
|
}
|