feat: add type to fs read api
This commit is contained in:
@ -1,15 +1,16 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"io/ioutil"
|
||||
|
||||
json "github.com/json-iterator/go"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"io/ioutil"
|
||||
)
|
||||
|
||||
var Json = json.ConfigCompatibleWithStandardLibrary
|
||||
|
||||
// WriteToJson write struct to json file
|
||||
func WriteToJson(src string, conf interface{}) bool {
|
||||
// WriteJsonToFile write struct to json file
|
||||
func WriteJsonToFile(src string, conf interface{}) bool {
|
||||
data, err := Json.MarshalIndent(conf, "", " ")
|
||||
if err != nil {
|
||||
log.Errorf("failed convert Conf to []byte:%s", err.Error())
|
||||
|
Reference in New Issue
Block a user