This commit is contained in:
crusader 2018-04-06 19:42:32 +09:00
parent 5f64fccd7c
commit 0e6d2d1b4b

View File

@ -130,13 +130,15 @@ func (src *ServerRequestCodec) NewResponse(reply interface{}, err error) ([]byte
func (src *ServerRequestCodec) NewResponseWithString(reply string, err error) ([]byte, error) {
res := src.newServerResponse(nil, err)
var i interface{}
mErr := json.Unmarshal([]byte(reply), &i)
if nil != mErr {
return nil, mErr
}
if "" != reply {
var i interface{}
mErr := json.Unmarshal([]byte(reply), &i)
if nil != mErr {
return nil, mErr
}
res.Result = i
res.Result = i
}
return json.Marshal(res)
}