Capital Letters = export
> On Nov 1, 2018, at 9:22 AM, Alex Dvoretskiy wrote:
>
> No, no need to export, unless fields have weird names. Fields must be with
> capital letters:
>
> https://play.golang.org/p/zMeKqW-4JT9
>
> On Wednesday, October 31, 2018 at 11:12:05 PM UTC-7, kortschak wrote:
>
No, no need to export, unless fields have weird names. Fields must be with
capital letters:
https://play.golang.org/p/zMeKqW-4JT9
On Wednesday, October 31, 2018 at 11:12:05 PM UTC-7, kortschak wrote:
>
> https://play.golang.org/p/Se8wXfYZVZG
>
> You need to export the field:
> ```
> Struct va
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 a
11:07 PM (less than a minute ago)
How can I get this json in output?
[
{
"s": 123,
"id": "adsfasdf"
},
{
"s": 123,
"id": "sefascss"
}
]
https://play.golang.org/p/cQNIKuGXRmj
--
You received this message because you are subscribed to the
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.
You have to export any fields to marshal, or other packages (including
encoding/json) can't see them.
https://play.golang.org/p/W5R4oH0oUR
On Jan 8, 2017 01:30, "Eric Brown" wrote:
> Simple example... what am I doing wrong?
>
> https://play.golang.org/p/WR9yehNF5_
>
> --
> You received this mes
Simple example... what am I doing wrong?
https://play.golang.org/p/WR9yehNF5_
--
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...@googlegroup