BROKEN: attempt to replace go-wire.JSON with json.Unmarshall in rpc

This commit is contained in:
Ethan Frey
2017-04-28 16:24:06 +02:00
parent bff8402fe8
commit 6c60c07f16
7 changed files with 77 additions and 52 deletions

View File

@ -280,9 +280,8 @@ func httpParamsToArgs(rpcFunc *RPCFunc, r *http.Request) ([]reflect.Value, error
}
func _jsonStringToArg(ty reflect.Type, arg string) (reflect.Value, error) {
var err error
v := reflect.New(ty)
wire.ReadJSONPtr(v.Interface(), []byte(arg), &err)
err := json.Unmarshal([]byte(arg), v.Interface())
if err != nil {
return v, err
}
@ -315,9 +314,8 @@ func nonJsonToArg(ty reflect.Type, arg string) (reflect.Value, error, bool) {
}
if isQuotedString && expectingByteSlice {
var err error
v := reflect.New(reflect.TypeOf(""))
wire.ReadJSONPtr(v.Interface(), []byte(arg), &err)
err := json.Unmarshal([]byte(arg), v.Interface())
if err != nil {
return reflect.ValueOf(nil), err, false
}