map增加toString

This commit is contained in:
2023-08-15 20:46:43 +08:00
parent 1a7414bb75
commit 0c8a013bdb
5 changed files with 46 additions and 0 deletions

View File

@ -327,3 +327,14 @@ func (n *normal) ToStruct(receiver interface{}) error {
decoder.UseNumber()
return decoder.Decode(receiver)
}
// ToString 转字符串
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 20:44 2023/8/15
func (n *normal) ToString() string {
mapData := n.GetAll()
byteData, _ := json.Marshal(mapData)
return string(byteData)
}