I think what they are saying there is that the `,inline` tag part is
ignored by the JSON encoding and decoding software, and it's just there for
documentation - to remind humans that the struct will be inlined in the
resulting JSON. The reason the struct is inlined is because it is an
"anonymous struct field". This is explained in the doc for Marshal in
encoding/json.

"Anonymous struct fields are usually marshaled as if their inner exported
fields were fields in the outer struct, subject to the usual Go visibility
rules amended as described in the next paragraph."

On Tue, Sep 27, 2016 at 2:22 PM Nick Leli <[email protected]> wrote:

> After inspecting some Kubernetes code
> <https://github.com/kubernetes/kubernetes/blob/c19e08ebbc2d58e5996e7e968c740e46054bd3ee/pkg/api/types.go#L180>,
> I see the json `inline` used throughout to create persistent structs.  This
> topic appears to be a proposal
> <https://groups.google.com/forum/#!topic/golang-nuts/le2do25dpa8> from a
> few years ago, yet I don't see any public documentation on the matter, just
> a reference
> <https://github.com/emicklei/go-restful/issues/160#issuecomment-62558586>
> to Google having the documentation.  Is there any public documentation I am
> not seeing?
>
> --
> 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 [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

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

Reply via email to