Closed tchap closed 7 years ago
Totally, I think I actually met bugs because of this. Would this fix still allow to set result
to null
or an empty array?
Totally, I think I actually met bugs because of this. Would this fix still allow to set result to null or an empty array?
Yes. You can make the Result point to a json.RawMessage
which is just []byte("null")
.
We will have to test this a bit before deploying it at Sourcegraph.com though.
cc @sqs
@tchap thanks so much for the fix.
Thanks for merging so quickly 👍
The 'result' key MUST be unset according when the error key is set. This is not what is happening right now. When the error is set, "result":null is returned in the response payload. This patch is fixing the issue by adding omitempty for the result field.
Fixes #13