https://play.golang.org/p/Se8wXfYZVZG

You need to export the field:
```
Struct values encode as JSON objects. Each exported struct field
becomes a member of the object, using the field name as the object key,
unless the field is omitted for one of the reasons given below.
```

On Wed, 2018-10-31 at 23:07 -0700, Alex Dvoretskiy wrote:
> How can I get this json in output?
>
> [
>     {
>         "s": 123,
>         "id": "adsfasdf"
>     },
>     {
>         "s": 123,
>         "id": "sefascss"
>     }
> ]
>
> https://play.golang.org/p/AHcUO5IuByf
>
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to