优化any -> string
This commit is contained in:
parent
1dd7ccf026
commit
a427bc63c5
3
any.go
3
any.go
@ -8,6 +8,7 @@
|
|||||||
package wrapper
|
package wrapper
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"git.zhangdeman.cn/zhangdeman/serialize"
|
"git.zhangdeman.cn/zhangdeman/serialize"
|
||||||
"reflect"
|
"reflect"
|
||||||
)
|
)
|
||||||
@ -96,7 +97,7 @@ func (at *AnyType) ToString() String {
|
|||||||
case DataTypePtr:
|
case DataTypePtr:
|
||||||
return String(serialize.JSON.MarshalForString(at.data))
|
return String(serialize.JSON.MarshalForString(at.data))
|
||||||
}
|
}
|
||||||
return String("")
|
return String(fmt.Sprintf("%v", at.data))
|
||||||
}
|
}
|
||||||
|
|
||||||
// ToObject 任意类型转为对象
|
// ToObject 任意类型转为对象
|
||||||
|
Loading…
Reference in New Issue
Block a user