This commit is contained in:
parent
6bb0bce557
commit
3ff1338b97
@ -73,8 +73,10 @@ func ObjToSlice(obj interface{}, e ...*Error) Slice {
|
|||||||
err = json.Unmarshal([]byte(obj.(string)), &v)
|
err = json.Unmarshal([]byte(obj.(string)), &v)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
v = nil
|
v = Slice{}
|
||||||
err = errors.New("没有合适的转换对象!")
|
var data []byte
|
||||||
|
data, err = json.Marshal(obj)
|
||||||
|
err = json.Unmarshal(data, &v)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user