From 53a8a40785fe6c8d68f4d842fe49a41236721ec8 Mon Sep 17 00:00:00 2001 From: Jae Kwon Date: Fri, 22 Jan 2016 16:18:35 -0800 Subject: [PATCH] Swap Query return params --- example/golang/counter.go | 4 ++-- example/golang/dummy.go | 4 ++-- server/server.go | 2 +- types/application.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/example/golang/counter.go b/example/golang/counter.go index 46edcb413..434aa57b5 100644 --- a/example/golang/counter.go +++ b/example/golang/counter.go @@ -77,6 +77,6 @@ func (app *CounterApplication) RemListener(key string) types.RetCode { return types.RetCodeOK } -func (app *CounterApplication) Query(query []byte) (types.RetCode, []byte) { - return types.RetCodeOK, nil +func (app *CounterApplication) Query(query []byte) ([]byte, types.RetCode) { + return nil, types.RetCodeOK } diff --git a/example/golang/dummy.go b/example/golang/dummy.go index 543e865b8..899bb4954 100644 --- a/example/golang/dummy.go +++ b/example/golang/dummy.go @@ -52,6 +52,6 @@ func (app *DummyApplication) RemListener(key string) types.RetCode { return types.RetCodeOK } -func (app *DummyApplication) Query(query []byte) (types.RetCode, []byte) { - return types.RetCodeOK, nil +func (app *DummyApplication) Query(query []byte) ([]byte, types.RetCode) { + return nil, types.RetCodeOK } diff --git a/server/server.go b/server/server.go index 8a6a16d91..f6aa22973 100644 --- a/server/server.go +++ b/server/server.go @@ -128,7 +128,7 @@ func handleRequest(app types.Application, req types.Request, responses chan<- ty retCode := app.RemListener(req.EventKey) responses <- types.ResponseRemListener{retCode} case types.RequestQuery: - retCode, result := app.Query(req.QueryBytes) + result, retCode := app.Query(req.QueryBytes) responses <- types.ResponseQuery{retCode, result} default: responses <- types.ResponseException{"Unknown request"} diff --git a/types/application.go b/types/application.go index 4a0818fdc..b9bd1985f 100644 --- a/types/application.go +++ b/types/application.go @@ -27,5 +27,5 @@ type Application interface { RemListener(key string) RetCode // Query for state - Query(query []byte) (RetCode, []byte) + Query(query []byte) ([]byte, RetCode) }