From 3432f85c3da2a5b48a03906a3ccdc9b6ee96c055 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Wed, 11 Oct 2023 17:20:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=BD=AC=E4=B8=BA=E5=AF=B9?= =?UTF-8?q?=E8=B1=A1=E7=9A=84=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- any.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/any.go b/any.go index 925a7f5..5437815 100644 --- a/any.go +++ b/any.go @@ -96,5 +96,17 @@ func (at *AnyType) ToString() String { case DataTypePtr: return String(serialize.JSON.MarshalForString(at.data)) } - return "" + return String("") +} + +// ToObject 任意类型转为对象 +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 17:19 2023/10/11 +func (at *AnyType) ToObject() MapResult { + return MapResult{ + Value: EasyMapFromString(at.ToString().Value()), + Err: nil, + } }