From 5ad07aa0a61a102e13717057c6bd0c43d9750ab7 Mon Sep 17 00:00:00 2001 From: hoteas Date: Mon, 13 Nov 2017 10:20:35 +0000 Subject: [PATCH] --- trunk/src/go.hoteas.com/hotime/objtoobj.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/trunk/src/go.hoteas.com/hotime/objtoobj.go b/trunk/src/go.hoteas.com/hotime/objtoobj.go index 1008c71..ae2da10 100644 --- a/trunk/src/go.hoteas.com/hotime/objtoobj.go +++ b/trunk/src/go.hoteas.com/hotime/objtoobj.go @@ -73,8 +73,10 @@ func ObjToSlice(obj interface{}, e ...*Error) Slice { err = json.Unmarshal([]byte(obj.(string)), &v) default: - v = nil - err = errors.New("没有合适的转换对象!") + v = Slice{} + var data []byte + data, err = json.Marshal(obj) + err = json.Unmarshal(data, &v) } }