xichen2020 / eventdb

Storage for discrete events such as log events or tracing events
Apache License 2.0
9 stars 1 forks source link

MarshalJSON panics if response is empty #117

Closed notbdu closed 5 years ago

notbdu commented 5 years ago

MarshalJSON methods need to return JSON encodable bytes if there is an empty response or the JSON encoder errors out.

--- FAIL: TestRawQueryGroupBy (17.83s)
    raw_query_groupby_test.go:46:
                Error Trace:    raw_query_groupby_test.go:46
                Error:          Received unexpected error:
                                received '500' status code: {"state":"Error","error":"json: error calling MarshalJSON for type *query.GroupedResults: unexpected end of JSON input"}
                Test:           TestRawQueryGroupBy