1 Star 4 Fork 3

tym_hmm/go-helper

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
JsonHelper.go 326 Bytes
一键复制 编辑 原始数据 按行查看 历史
天蝎儿 提交于 4年前 . 修改目录结构
package StringHelper
import (
"bytes"
"encoding/json"
)
/**
map转json
*/
func MapToJson(data map[string]interface{}) (string, error) {
if data == nil {
data = map[string]interface{}{}
}
var buf bytes.Buffer
err := json.NewEncoder(&buf).Encode(data)
if err != nil {
return "", err
}
return buf.String(), nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/tym_hmm/go-helper.git
git@gitee.com:tym_hmm/go-helper.git
tym_hmm
go-helper
go-helper
v1.1.170

搜索帮助