Re: [go-nuts] Sending Json Data with different types

2020-01-18 Thread Dan Kortschak
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 > >

Re: [go-nuts] Sending Json Data with different types

2020-01-18 Thread burak serdar
On Sat, Jan 18, 2020 at 10:28 PM wrote: > > I have a server that requires data to be sent back that looks like this > > {"jsonrpc": "2.0", "result": [false, "", "", ""], "id": 1} https://play.golang.org/p/WYrvolLytd9 Use a []interface{} for "result". > > Using json Encoder and Json

[go-nuts] New tutorial series: Terminal-based Tetris - Part 1: Procedural polyomino generation

2020-01-18 Thread tslocum
Hey Gophers, I've just published the first part in a series of tutorials on writing your own Tetris clone. You can find it here: https://rocketnine.space/post/tetris-1/ -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

[go-nuts] Sending Json Data with different types

2020-01-18 Thread Ramkiller1
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

[go-nuts] run tests for all sub modules

2020-01-18 Thread Vasiliy Tolstov
Hi! I have one repo with multiple packages. For each package i have dedicated go.mod (this is a requirement because repo is collection of plugins with many deps). How to run test for all of them? go test ./... does not run tests for sub modules. Now i have very ugly thing: find . -name 'go.mod' ,

Re: [go-nuts] Best way to buffer upstream responses in reverse proxy

2020-01-18 Thread Prabhu Chawandi
Thank you for the pointers. I will dig more into them. Thanks, Prabhu On Sat, Jan 18, 2020 at 12:10 PM Tamás Gulácsi wrote: > Start simple: use a *bytes.Buffer, and help the GC with using a sync.Pool > for those buffers. > > -- > You received this message because you are subscribed to the