mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
update
This commit is contained in:
@ -2,12 +2,13 @@ package json
|
||||
|
||||
import "github.com/charlienet/go-mixed/bytesconv"
|
||||
|
||||
// StructToJsonIndent 结构转换为带格式字符串
|
||||
func StructToJsonIndent(obj any) string {
|
||||
b, _ := MarshalIndent(obj, "", " ")
|
||||
return bytesconv.BytesToString(b)
|
||||
}
|
||||
|
||||
// 结构转换为json字符串
|
||||
// StructToJson 结构转换为json字符串
|
||||
func StructToJson(obj any) string {
|
||||
b, _ := Marshal(obj)
|
||||
return bytesconv.BytesToString(b)
|
||||
|
Reference in New Issue
Block a user