Try something like this: https://play.golang.org/p/hcI8eMo08Wx

Your array type needs to be an interface type to allow the different
value types.

On Sat, 2020-01-18 at 12:30 -0800, ramkill...@hotmail.com wrote:
> I have a server that requires data to be sent back that looks like
> this
> 
> {"jsonrpc": "2.0", "result": [false, "", "", ""], "id": 1}
> 
> Using json Encoder and Json Marshalling, the closes I have come up
> with is 
> 
> {
>    "id": 1,
>    "jsonrpc": "2.0",
>    "result": "[false,\"\",\"\",\"\"]"
> }
> 
> Is this possible to do? 
> https://play.golang.org/p/m936B_asGai
> 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/285b24aa4568f9d81cef5a5e410fee3cebb8533a.camel%40kortschak.io.

Reply via email to