示例#1
0
文件: utils.go 项目: jmptrader/spirit
func printObject(title string, v interface{}) {
	if v == nil {
		return
	}

	data, _ := env_json.MarshalIndent(v, "", "    ")

	fmt.Println(title+":\n", string(data))
}
示例#2
0
func (p *runtimeConfig) Serialize() (str string, err error) {
	var data []byte
	if data, err = env_json.MarshalIndent(p, "", "    "); err != nil {
		return
	}

	str = string(data)

	return
}
示例#3
0
func (p Options) Serialize() (str string, err error) {
	var data []byte
	if data, err = env_json.MarshalIndent(&p, "", "    "); err != nil {
		return
	}

	str = string(data)

	return
}