diff options
Diffstat (limited to 'src/pkg/rpc/jsonrpc')
| -rw-r--r-- | src/pkg/rpc/jsonrpc/all_test.go | 6 | ||||
| -rw-r--r-- | src/pkg/rpc/jsonrpc/client.go | 12 | ||||
| -rw-r--r-- | src/pkg/rpc/jsonrpc/server.go | 12 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/pkg/rpc/jsonrpc/all_test.go b/src/pkg/rpc/jsonrpc/all_test.go index 02b9735eb..c1a9e8ecb 100644 --- a/src/pkg/rpc/jsonrpc/all_test.go +++ b/src/pkg/rpc/jsonrpc/all_test.go @@ -51,9 +51,9 @@ func init() { func TestServer(t *testing.T) { type addResp struct { - Id interface{} "id" - Result Reply "result" - Error interface{} "error" + Id interface{} `json:"id"` + Result Reply `json:"result"` + Error interface{} `json:"error"` } cli, srv := net.Pipe() diff --git a/src/pkg/rpc/jsonrpc/client.go b/src/pkg/rpc/jsonrpc/client.go index 57e977d32..577d0ce42 100644 --- a/src/pkg/rpc/jsonrpc/client.go +++ b/src/pkg/rpc/jsonrpc/client.go @@ -44,9 +44,9 @@ func NewClientCodec(conn io.ReadWriteCloser) rpc.ClientCodec { } type clientRequest struct { - Method string "method" - Params [1]interface{} "params" - Id uint64 "id" + Method string `json:"method"` + Params [1]interface{} `json:"params"` + Id uint64 `json:"id"` } func (c *clientCodec) WriteRequest(r *rpc.Request, param interface{}) os.Error { @@ -60,9 +60,9 @@ func (c *clientCodec) WriteRequest(r *rpc.Request, param interface{}) os.Error { } type clientResponse struct { - Id uint64 "id" - Result *json.RawMessage "result" - Error interface{} "error" + Id uint64 `json:"id"` + Result *json.RawMessage `json:"result"` + Error interface{} `json:"error"` } func (r *clientResponse) reset() { diff --git a/src/pkg/rpc/jsonrpc/server.go b/src/pkg/rpc/jsonrpc/server.go index 9c6b8b40d..9801fdf22 100644 --- a/src/pkg/rpc/jsonrpc/server.go +++ b/src/pkg/rpc/jsonrpc/server.go @@ -43,9 +43,9 @@ func NewServerCodec(conn io.ReadWriteCloser) rpc.ServerCodec { } type serverRequest struct { - Method string "method" - Params *json.RawMessage "params" - Id *json.RawMessage "id" + Method string `json:"method"` + Params *json.RawMessage `json:"params"` + Id *json.RawMessage `json:"id"` } func (r *serverRequest) reset() { @@ -59,9 +59,9 @@ func (r *serverRequest) reset() { } type serverResponse struct { - Id *json.RawMessage "id" - Result interface{} "result" - Error interface{} "error" + Id *json.RawMessage `json:"id"` + Result interface{} `json:"result"` + Error interface{} `json:"error"` } func (c *serverCodec) ReadRequestHeader(r *rpc.Request) os.Error { |
