From da840f38554127799974042f84939b9700ced3b5 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Wed, 9 Apr 2014 13:01:59 -0500 Subject: [PATCH] Add a comment for FinishUnmarshal. --- rpc.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rpc.go b/rpc.go index bfe5f65..6858ccf 100644 --- a/rpc.go +++ b/rpc.go @@ -29,6 +29,11 @@ type RawRPCResponse struct { Error *json.RawMessage `json:"error"` } +// FinishUnmarshal unmarshals the result and error of a raw RPC response. +// If v is non-nil, the result is unmarshaled into the variable pointed +// to by the interface rather than using the rules in the encoding/json +// package to allocate a new variable for the result. The final result +// and JSON-RPC error is returned. func (r *RawRPCResponse) FinishUnmarshal(v interface{}) (interface{}, *btcjson.Error) { // JSON-RPC spec makes this handling easier-ish because both result and // error cannot be non-nil.